generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 1
Add thread safety to execution operations #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
e853482 to
238c7a9
Compare
yaythomas
requested changes
Oct 16, 2025
Member
|
please remember to clean-up commit history before final merge... |
d539e2b to
dc73230
Compare
440f3f2 to
db8551b
Compare
- Added thread-safe synchronization to Execution and InMemoryExecutionStore classes using standard threading.Lock - Execution.py: Added _state_lock (Lock) to synchronize all state modifications including token sequence increments, operations list updates, and used tokens modifications in methods like start(), get_new_checkpoint_token(), complete_wait(), and complete_retry() - stores/memory.py: Added _lock (Lock) to ensure atomic operations for save(), load(), update(), and list_all() methods - Added unit tests for execution operations: - tests/execution_concurrent_test.py: Added concurrent access tests verifying thread-safe operations under multi-threaded scenarios - tests/execution_wait_retry_test.py: Added tests for wait and retry operations - tests/stores/concurrent_test.py: Added concurrent access tests for InMemoryExecutionStore verifying thread-safe operations - Made token_sequence a read-only property without setter to encapsulate mutations within the class
db8551b to
9a68680
Compare
yaythomas
approved these changes
Oct 16, 2025
Member
yaythomas
left a comment
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.
Looking good :-) ![]()
Please remember to conform commit message to https://www.conventionalcommits.org/en/v1.0.0/
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:
closes #31
closes #32
Description of changes:
Dependencies
If this PR requires testing against a specific branch of the Python Language SDK (e.g., for unreleased changes), uncomment and specify the branch below. Otherwise, leave commented to use the main branch.
PYTHON_LANGUAGE_SDK_BRANCH: lambda-ctx
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.