Repository navigation
fix(batch): reject servers older than 1.36 in batch.start() - #640
Open
dudanogueira wants to merge 1 commit into
Open
dudanogueira wants to merge 1 commit into
dudanogueira wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the change adding a server-version guard for batch streaming.
No open issues 🎉
What changed in this PR
Prevents batch.start() from hanging on Weaviate servers older than 1.36 by checking the server version before opening a batch stream, addressing #634.
Changes:
- Carries the server version from connection metadata through the gRPC transport.
- Adds a shared guard for both
start()overloads, comparing major and minor directly to avoid the comparison bug in #631. - Adds version-boundary tests and a regression test for rejecting Weaviate 1.35.6.
| File | Description |
|---|---|
src/test/java/io/weaviate/testutil/transport/MockGrpcTransport.java |
Supports configurable server versions in tests. |
src/test/java/io/weaviate/client6/v1/internal/VersionSupportTest.java |
Tests version boundaries, prereleases, and newer major versions. |
src/test/java/io/weaviate/client6/v1/api/collections/batch/WeaviateBatchClientTest.java |
Verifies rejection of an unsupported server version. |
src/main/java/io/weaviate/client6/v1/internal/VersionSupport.java |
Defines the batching minimum version and direct version comparison. |
src/main/java/io/weaviate/client6/v1/internal/grpc/GrpcTransport.java |
Exposes an optional server version. |
src/main/java/io/weaviate/client6/v1/internal/grpc/GrpcChannelOptions.java |
Stores and preserves the server version in channel options. |
src/main/java/io/weaviate/client6/v1/internal/grpc/DefaultGrpcTransport.java |
Exposes the configured server version through the transport. |
src/main/java/io/weaviate/client6/v1/api/WeaviateClientAsync.java |
Passes connection metadata’s server version to gRPC options. |
src/main/java/io/weaviate/client6/v1/api/WeaviateClient.java |
Passes connection metadata’s server version to gRPC options. |
src/main/java/io/weaviate/client6/v1/api/collections/batch/WeaviateBatchClient.java |
Checks batching compatibility before either start path opens a stream. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On servers older than 1.36,
batch.start()opened the stream and waited forever for aStartedmessage that never came. The client now keeps the server version it reads at connect time, andstart()throws anIllegalStateExceptionwhen the server is older than 1.36.The version check compares major and minor directly instead of using
SemanticVersion.compareTo, which still has the bug from #631.Closes #634