-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "identity not yet recieved" intermittent failure in tests (#445)
This error turns out to have been a legitimate, albeit rare, race condition, which could have (but apparently didn't) manifested in user code. The cause, ultimately, was holding locks for too-short scopes while initializing the connection. It was possible for a new connection to receive and completely process its `IdentityToken` message before calling `maybe_set_credentials`, which would then clobber the received identity. This is now fixed (hopefully) by holding the `CredentialStore` lock for the duration of `BackgroundDbConnection::connect`. Two other locks, on `ClientCache` and `ReducerCallbacks`, are also newly held for the duration to avoid similar issues. In addition, this commit adds a call to `disconnect` to the beginning of `connect`. This will prevent pathological user code which connects twice in a row without an intervening disconnect from encountering bizarre errors caused by the first connection's background workers staying active. This commit also bumps the `RUST_LOG` env variable for the SDK test clients to `trace`, and adds several trace-level logs to the SDK, which were instrumental in pinning down the failure. This does mean that log output of failed SDK tests will now be much noisier.
- Loading branch information
Showing
3 changed files
with
62 additions
and
29 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
60b77ae
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmark results
Benchmark Report
Legend:
load
: number of rows pre-loaded into the databasecount
: number of rows touched by the transactionunique
: a single index on theid
columnnon_unique
: no indexesmulti_index
: non-unique index on every columnperson(id: u32, name: String, age: u64)
location(id: u32, x: u64, y: u64)
All throughputs are single-threaded.
Empty transaction
Single-row insertions
Multi-row insertions
Full table iterate
Find unique key
Filter
Serialize
Module: invoke with large arguments
Module: print bulk
Remaining benchmarks