Skip to content

fix(batch): reject servers older than 1.36 in batch.start() - #640

Open
dudanogueira wants to merge 1 commit into
mainfrom
fix/batch-require-1.36
Open

dudanogueira wants to merge 1 commit into
mainfrom
fix/batch-require-1.36

Conversation

@dudanogueira

@dudanogueira dudanogueira commented Nov 10, 2026 •

Copy link
Copy Markdown

On servers older than 1.36, batch.start() opened the stream and waited forever for a Started message that never came. The client now keeps the server version it reads at connect time, and start() throws an IllegalStateException when 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

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

batch.start() blocks forever on Weaviate < 1.36

2 participants