[v2] Reduce session database locking - #10522
Open
kdaily wants to merge 1 commit into
Open
Conversation
Reduce write-lock contention on the session database, which can cause slowdowns when the AWS CLI cache directory is on a network filesystem. - Add a check-before-delete in the sweeper to avoid taking a write lock when there are no expired records to remove - Only refresh the stored timestamp when it is older than 60 seconds, avoiding a write on every invocation - Set a short busy timeout (100ms) so the CLI does not block waiting for a database lock - Add debug logging for database errors instead of silently passing
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Continuation of #10517 but only the session locking component; the environment variable was merged in #10519.
Description of changes:
CLI v2 stores a "session ID" in a SQLite database in the
~/.awsdirectory. This stores a random ID that is rotated every 30 minutes, which allows some services to group command invocations together.This makes some changes to SQLite usage to reduce lock contention on the database when multiple commands are run on the same host concurrently.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.