fix(client): sleep between polls in the blocking poll helper - #1583
Open
cplieger wants to merge 1 commit into
Open
fix(client): sleep between polls in the blocking poll helper#1583cplieger wants to merge 1 commit into
cplieger wants to merge 1 commit into
Conversation
Two small defects in the execute-then-poll helpers. The blocking poll_update_until_complete had no delay in its loop, so it re-issued GetUpdate as fast as the network allowed for the entire duration of the execution. The async variant already sleeps 500ms; this matches it. The execute doc comment pointed readers at [execute_and_poll_until_complete], which does not exist. The function is execute_and_poll.
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.
Two small defects in the execute-then-poll helpers, found while working out why an Action's second
executeon one resource failed withResource is busy. (It was my bug: I should have usedexecute_and_poll. These two turned up on the way.)1. The blocking poll helper busy-loops
poll_update_until_completeunder#[cfg(feature = "blocking")]has no delay in its loop, so it re-issuesGetUpdateas fast as the network allows for the whole duration of the execution. For a Stack deploy that is minutes of hot looping against Core.The async variant already does
tokio::time::sleep(Duration::from_millis(500)). This adds the matchingstd::thread::sleep, same interval.Durationis already imported.2. A doc comment points at a function that does not exist
client/core/ts/src/lib.ts, onexecute:The exported function is
execute_and_poll. The surrounding note is genuinely useful, which is why the dangling name is worth fixing: it is the pointer a reader follows when they hit exactly the problem the note describes.Verification
cargo check -p komodo_client --features blockingclean,cargo fmtleaves it untouched. The TS change is a comment.