fix: Non-transactional multi-step context updates between metadata/to… - #1161
Merged
Merged
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
zmanian
approved these changes
Mar 14, 2026
zmanian
left a comment
Collaborator
There was a problem hiding this comment.
Review: Atomic context update-and-get to prevent concurrent interleaving
Clean fix for Issue #807. update_context() + get_context() were two separate lock acquisitions, allowing concurrent workers to modify state between them. New update_context_and_get() holds the write lock for both operations.
Positives:
update_context_and_getreturns the cloned context under the same write lock- Scheduler uses the returned context directly for
save_job, no second read needed - Edge case handled: metadata=None AND max_tokens=0 falls through to plain
get_context() - Regression test and concurrency test both verify atomicity
LGTM.
zmanian
enabled auto-merge (squash)
March 14, 2026 19:01
This was referenced Mar 16, 2026
Merged
11 tasks
bkutasi
pushed a commit
to bkutasi/ironclaw
that referenced
this pull request
Mar 28, 2026
nearai#1161) * fix: Non-transactional multi-step context updates between metadata/token setup and DB * fix: code style
drchirag1991
pushed a commit
to drchirag1991/ironclaw
that referenced
this pull request
Apr 8, 2026
nearai#1161) * fix: Non-transactional multi-step context updates between metadata/token setup and DB * fix: code style
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.
…ken setup and DB
Summary
Change Type
Linked Issue
Validation
cargo fmtcargo clippy --all --benches --tests --examples --all-featuresSecurity Impact
Database Impact
Blast Radius
Rollback Plan
Review track: