This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
19 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters