Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit 48494ad

Browse files
authored
bug: number of channels was inadvertently limited to 1 (#1169)
* bug: number of channels was inadvertently limited to 1 The intent was to ensure the number of channels was "at least one", but instead actually made it "at most one". There is no test for this because client_test uses the Client constructor directly. We should try to add one, but let's fix this obvious bug first.
1 parent 6311fd7 commit 48494ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

google/cloud/spanner/client.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ std::shared_ptr<Connection> MakeConnection(
246246
std::unique_ptr<RetryPolicy> retry_policy,
247247
std::unique_ptr<BackoffPolicy> backoff_policy) {
248248
std::vector<std::shared_ptr<internal::SpannerStub>> stubs;
249-
int num_channels = std::min(connection_options.num_channels(), 1);
249+
int num_channels = std::max(connection_options.num_channels(), 1);
250250
stubs.reserve(num_channels);
251251
for (int channel_id = 0; channel_id < num_channels; ++channel_id) {
252252
stubs.push_back(

0 commit comments

Comments
 (0)