You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 8, 2021. It is now read-only.
fix: avoid deadlock waiting for Session allocation (#1170)
* fix: avoid deadlock waiting for Session allocation
Track the number of threads waiting for a `Session` to ensure we always
notify properly; the prior implementation had race conditions that
could lead to a thread waiting forever even when a `Session` was
available (see #1000 for details).
I also removed the workaround for this bug in the benchmark. With
the workaround removed, I ran the benchmark using the flags below,
both with and without the `SessionPool` fix. Without the fix it
hangs reliably, with the fix it never hangs.
```
.build/google/cloud/spanner/benchmarks/single_row_throughput_benchmark \
--project=${GOOGLE_CLOUD_PROJECT} \
--instance=${GOOGLE_CLOUD_CPP_SPANNER_INSTANCE} \
--table-size=1000 \
--minimum-clients=1 --maximum-clients=1 \
--minimum-threads=1000 --maximum-threads=1000 \
--iteration-duration=2 --samples=100 \
--experiment=read
```
fixes#1000
* Factor "Wait" logic out to a private member function.
0 commit comments