Skip to content

fix(client): sleep between polls in the blocking poll helper - #1583

Open
cplieger wants to merge 2 commits into
moghtech:mainfrom
cplieger:fix/client-polling-busy-loop-and-doc-ref
Open

cplieger wants to merge 2 commits into
moghtech:mainfrom
cplieger:fix/client-polling-busy-loop-and-doc-ref

Conversation

@cplieger

@cplieger cplieger commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Two small defects in the execute-then-poll helpers.

1. The blocking poll helper busy-loops

poll_update_until_complete under #[cfg(feature = "blocking")] has no delay in its loop, so it re-issues GetUpdate as fast as the network allows for the whole execution. For a Stack deploy that is minutes of hot looping against Core. The async variant already sleeps 500 ms between polls; this adds the matching std::thread::sleep.

2. A doc comment points at a function that does not exist

client/core/ts/src/lib.ts, on execute, says to use [execute_and_poll_until_complete] to block until the task finishes. The exported function is execute_and_poll.

Verification

cargo check -p komodo_client --features blocking clean (it also clears the unused import: Duration warning the cfg'd-out variant left), cargo fmt --check clean.

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 branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant