-
-
Notifications
You must be signed in to change notification settings - Fork 710
Runlock telemetry #1974
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
Runlock telemetry #1974
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
11e1cfc
Added error throwing tests to runlock
matt-aitken 16e89f4
Added some more run lock tests
matt-aitken b4bc069
Added customConditions so the test can use the Logger
matt-aitken 30712b0
Fix for JSON error
matt-aitken 1b0f6dc
Added a span to the run lock with a name
matt-aitken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
💡 Verification agent
🧩 Analysis chain
Long-running callback risks lock expiry; propagate
signal
checks#handleStalledSnapshot
performs multiple DB round-trips and conditional branches that can easily exceed the 5 s lock TTL. Unlike thetrigger
path, the callback never callssignal.throwIfAborted()
nor refreshes the lock, so a competing worker could acquire the same lock mid-execution.Add periodic checks or extend the lock inside the callback, e.g.:
Also consider a slightly larger TTL (e.g. 10–15 s) to cover worst-case DB latency.
🏁 Script executed:
Length of output: 988
🏁 Script executed:
Length of output: 650
Ensure
handleStalledSnapshot
lock callback handles abort signal and extends TTLThe callback passed to
internal-packages/run-engine/src/engine/index.ts:1169
currently omits the
signal
parameter, preventing anysignal.throwIfAborted()
checks and risking lock expiry during its multiple DB round-trips. To prevent a competing worker from stealing the lock mid-execution and to handle timeouts:Change the callback signature to accept
signal: AbortSignal
and bump the TTL:Insert
signal.throwIfAborted()
after each heavy I/O or before key branches.Consider a TTL of 10 000–15 000 ms to cover worst-case DB latency.