Skip to content

Fix blocking std::thread::sleep in async runtime#23

Merged
emmajam merged 1 commit intotempoxyz:mainfrom
QuantumFUD:main
Feb 17, 2026
Merged

Fix blocking std::thread::sleep in async runtime#23
emmajam merged 1 commit intotempoxyz:mainfrom
QuantumFUD:main

Conversation

@QuantumFUD
Copy link
Copy Markdown
Contributor

Issue:

wait_for_readiness is an async function but used std::thread::sleep, which blocks the Tokio runtime. Since this function is awaited from main, blocking calls pause the entire async executor for 5 seconds on each retry.

Fix:

Replaced std::thread::sleep with tokio::time::sleep(...).await and removed the blocking import and closure.

Impact:

The function is now fully non-blocking and correctly cooperates with the async runtime. This prevents unnecessary executor blocking and improves overall responsiveness.

@emmajam
Copy link
Copy Markdown
Member

emmajam commented Feb 17, 2026

this its negligible impact but good hygiene - will merge

@emmajam emmajam merged commit 7e6ff88 into tempoxyz:main Feb 17, 2026
3 checks passed
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.

2 participants