You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "slfan1989 (via GitHub)" <gi...@apache.org> on 2026/09/07 13:06:33 UTC

[PR] [rust] Return error for out-of-range server API versions [fluss]

slfan1989 opened a new pull request, #4244:
URL: https://github.com/apache/fluss/pull/4244

   ### Purpose
   
   <!-- Linking this pull request to the issue -->
   Linked issue: close #4241
   
   `ServerApiVersions::new()` converted the `api_key`, `min_version`, and `max_version` fields received from the server from `i32` to `i16` using `unwrap()`.
   
   An out-of-range value in the server's `ApiVersionsResponse` could therefore panic the Rust client during connection establishment.
   
   This change makes invalid server API version values return a descriptive error instead of causing a panic.
   
   ### Brief change log
   
   - Change `ServerApiVersions::new()` to return `Result<ServerApiVersions, Error>`.
   - Replace the integer conversion `unwrap()` calls with checked conversions.
   - Include the invalid field name and value in the returned error.
   - Preserve the conversion error as the error source.
   - Propagate validation errors through the API version handshake.
   - Add unit tests for out-of-range:
     - `api_key`
     - `min_version`
     - `max_version`
   
   ### Tests
   
   Manually ran the unit tests.
   
   ```
   cargo test -p fluss-rs --all-targets
   ```
   
   ### API and Format
   
   No.
   
   ### Documentation
   
   No.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rust] Return error for out-of-range server API versions [fluss]

Posted by "fresh-borzoni (via GitHub)" <gi...@apache.org>.
fresh-borzoni merged PR #4244:
URL: https://github.com/apache/fluss/pull/4244


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [rust] Return error for out-of-range server API versions [fluss]

Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on PR #4244:
URL: https://github.com/apache/fluss/pull/4244#issuecomment-5673471853

   > @slfan1989 Thank you for the PR, LGTM 👍
   
   @fresh-borzoni Thanks for the review and merge!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org