Skip to content

Commit 81d3fb0

Browse files
authored
bug: number of channels was inadvertently limited to 1 (googleapis/google-cloud-cpp-spanner#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 af921e8 commit 81d3fb0

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)