Closed dbolduc closed 10 months ago
I am sure there is a bug, but not the mutable
thing:
https://godbolt.org/z/q4rMnb65a
id
is captured by reference, the reference is not changing (it can't, but that is neither here nor there).
Hm.... I have a test that passes with or without the mutable
, and I see your godbolt link....
I probably:
mutable
to the lambdaand thought 2 was the real fix.
I am sure there is a bug
Probably not. :unamused:
I noticed this when refactoring Bigtable to pull the
GrpcAuthenticationStrategy
creation outside of the stub factory. Using a mock revealed that we were setting everygrpc.channel_id
to0
. The whole point of setting the arg is to give each channel a unique value, so they use a distinct channel pool.https://github.com/googleapis/google-cloud-cpp/blob/11fd85cb6ad31a07c6025ac5254e3ffd7ebe2922/google/cloud/bigtable/internal/bigtable_stub_factory.cc#L68-L70
This lambda needs to be
mutable
. We also need to fix this inpubsub
andstorage
.