Skip to content

fix(store): bind each gRPC stub to its own channel - #3128

Open
bitflicker64 wants to merge 1 commit into
apache:masterfrom
bitflicker64:fix/hstore-grpc-stub-channel-3125
Open

fix(store): bind each gRPC stub to its own channel#3128
bitflicker64 wants to merge 1 commit into
apache:masterfrom
bitflicker64:fix/hstore-grpc-stub-channel-3125

Conversation

@bitflicker64

Copy link
Copy Markdown
Contributor

Purpose of the PR

AbstractGrpcClient creates 32 managed channels per target, but both
stub-pool initialization loops bound every entry to one channel selected
before the loop. Traffic was concentrated on a single connection while the
other 31 channels remained idle.

Main Changes

  • Bind each blocking-stub pool entry to the channel at the same pool index.
  • Bind each asynchronous-stub pool entry to the channel at the same pool index.
  • Add self-contained tests with fake channels and stubs that verify both pools
    cover every channel without a running PD or Store cluster.
  • Add ClientSuiteTest so the existing store-client-test profile runs the
    new coverage without including cluster-dependent client tests.

Verifying these changes

  • Need tests and can be verified as follows:
    • On the original indexing, both tests fail with 32 channels expected and 1 used.
    • mvn install -pl hugegraph-struct -am -DskipTests: passed.
    • mvn test -pl hugegraph-store/hg-store-test -am -P store-client-test: 2 passed, 0 failed.
    • mvn editorconfig:format: no files changed.
    • mvn clean compile -Dmaven.javadoc.skip=true: passed on Java 11.

Does this PR potentially affect the following parts?

  • Dependencies
  • Modify configurations
  • The public API
  • Other affects
  • Nope

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

AbstractGrpcClient opens concurrency (32) ManagedChannels per target, but
both stub-pool initializers used one precomputed channel index inside their
loops. Every pool entry therefore pointed at the same channel while the other
31 channels remained idle.

- use channels[i] in the blocking and async pool initializers
- add self-contained tests that verify every pool channel is bound
- add ClientSuiteTest so the store-client-test profile runs the tests

Fixes apache#3125
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working store Store module tests Add or improve test cases labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files. store Store module tests Add or improve test cases

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

[Bug][HStore Client] gRPC stub pools bind every entry to one ManagedChannel

1 participant