Unverified Commit 62be3670 authored by Alec's avatar Alec Committed by GitHub
Browse files

[BugFix] Add sleep to fix tight loop and release GIL (#29476)


Signed-off-by: default avataralec-flowers <aflowers@nvidia.com>
Signed-off-by: default avatarAlec <35311602+alec-flowers@users.noreply.github.com>
Co-authored-by: default avatarNick Hill <nhill@redhat.com>
parent 500f26e6
...@@ -923,6 +923,13 @@ class EngineCoreProc(EngineCore): ...@@ -923,6 +923,13 @@ class EngineCoreProc(EngineCore):
# Post-step hook. # Post-step hook.
self.post_step(model_executed) self.post_step(model_executed)
# If no model execution happened but there are waiting requests
# (e.g., WAITING_FOR_REMOTE_KVS), yield the GIL briefly to allow
# background threads (like NIXL handshake) to make progress.
# Without this, the tight polling loop can starve background threads.
if not model_executed and self.scheduler.has_unfinished_requests():
time.sleep(0.001)
return model_executed return model_executed
def _handle_client_request( def _handle_client_request(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment