[Enhancement] Patch OmniStage.try_collect() with _proc alive checks (#1560)

Signed-off-by: Daniel Huang <daniel1.huang@intel.com>
This commit is contained in:
Daniel Huang authored and GitHub committed 2026-03-12 10:40:42 +08:00
1 parent e1efcb7560
commit ac17431745
2 files changed
+9 -3

No files matched your search

+1 -1
View File
@@ -345,7 +345,7 @@ def _setup_multiprocessing_mocks(monkeypatch: pytest.MonkeyPatch, mocker: Mocker
fake_process_instance = mocker.MagicMock()
fake_process_instance.start = mocker.MagicMock()
fake_process_instance.join = mocker.MagicMock()
fake_process_instance.is_alive = mocker.MagicMock(return_value=False)
fake_process_instance.is_alive = mocker.MagicMock(return_value=True)
fake_process_instance.terminate = mocker.MagicMock()
fake_process_class.return_value = fake_process_instance
+8 -2
View File
@@ -693,8 +693,14 @@ class OmniStage:
assert self._out_q is not None
try:
return self._out_q.get_nowait()
except Exception:
return None
except queue.Empty:
pass
except Exception as e:
logger.error("Unexpected error when collecting OmniStage output queue:", exc_info=e)
self.stop_stage_worker()
raise
if self._proc is not None and not self._proc.is_alive():
raise RuntimeError(f"OmniStage Worker process died unexpectedly with exit code {self._proc.exitcode}")
def process_engine_inputs(
self,