File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
google-cloud-spanner/src/main/java/com/google/cloud/spanner Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -190,8 +190,13 @@ private SingleReadContext(Builder builder) {
190
190
this .bound = builder .bound ;
191
191
// single use transaction have a single RPC and hence there is no need
192
192
// of a channel hint. GAX will automatically choose a hint when used
193
- // with a multiplexed session.
194
- this .channelHint = getChannelHintOptions (session .getOptions (), null );
193
+ // with a multiplexed session. But GAX currently uses an AtomicLong to perform round-robin
194
+ // channel selection and that will cause contention issues at high-concurrency. So we are
195
+ // passing
196
+ // a random hint instead of doing GAX round-robin.
197
+ this .channelHint =
198
+ getChannelHintOptions (
199
+ session .getOptions (), ThreadLocalRandom .current ().nextLong (Long .MAX_VALUE ));
195
200
}
196
201
197
202
@ Override
You can’t perform that action at this time.
0 commit comments