File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
google-cloud-spanner/src/main/java/com/google/cloud/spanner Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -190,8 +190,12 @@ 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 a random hint instead of doing GAX round-robin.
196
+ this .channelHint =
197
+ getChannelHintOptions (
198
+ session .getOptions (), ThreadLocalRandom .current ().nextLong (Long .MAX_VALUE ));
195
199
}
196
200
197
201
@ Override
You can’t perform that action at this time.
0 commit comments