mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
docs(docker-tests): document why poll loop beats blocking exec in wait_for_container_ready
Tried replacing the N-times-docker-exec polling loop with a single blocking docker exec (in-container until/sleep loop). CI profiling showed this was a net regression: docker exec connection overhead on shared runners is ~0.7-1s per call, while the existing poll approach uses 3-7 quick 0.27s execs. The blocking approach traded fewer calls for longer per-call duration and lost. Reverted to the original poll loop, added a docstring note explaining why so the next person does not re-attempt the same optimization.
This commit is contained in:
parent
3e89edf830
commit
ca6ede33e1
1 changed files with 8 additions and 0 deletions
|
|
@ -195,6 +195,14 @@ def wait_for_container_ready(
|
|||
Raises ``TimeoutError`` if the container never becomes ready — much
|
||||
better than a fixed ``time.sleep()`` that either wastes time on fast
|
||||
machines or flakes on slow ones.
|
||||
|
||||
Note: an earlier iteration tried a single blocking ``docker exec``
|
||||
with an in-container ``until`` loop to eliminate polling overhead.
|
||||
That was a net regression on CI: the per-``docker exec`` connection
|
||||
overhead on shared runners (~0.7–1s) is higher than the cost of
|
||||
3–7 quick poll calls (0.27s each), so the blocking approach traded
|
||||
fewer calls for longer per-call duration and lost. The poll loop
|
||||
is kept because it's better suited to CI's docker exec cost profile.
|
||||
"""
|
||||
end = time.monotonic() + deadline_s
|
||||
while time.monotonic() < end:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue