Skip to content

fix(timeout): support Windows spawn semantics - #80

Open
dexhunter wants to merge 2 commits into
huggingface:mainfrom
dexhunter:fix/windows-timeout-subprocess
Open

fix(timeout): support Windows spawn semantics#80
dexhunter wants to merge 2 commits into
huggingface:mainfrom
dexhunter:fix/windows-timeout-subprocess

Conversation

@dexhunter

Copy link
Copy Markdown

Summary

  • replace the nested Windows multiprocessing target with a dedicated subprocess worker
  • serialize local callables, arguments, results, and exceptions with cloudpickle
  • keep worker I/O on private temporary files so user stdout cannot corrupt the protocol or block the parent
  • terminate the worker process tree when the timeout expires

Fixes #79

Why

Windows uses spawn semantics, so the previous nested run_func target could not be pickled. Valid parse and verify calls then failed or silently returned empty/false results. Running a package-owned worker module avoids importing the caller's __main__ module and also supports local callables.

I ran a 12-step autoresearch trajectory with Weco against a strict timeout contract evaluator: public run. The final patch keeps the subprocess/cloudpickle direction and adds bounded cleanup, isolated transport, and regression coverage.

Validation

The Windows coverage checks local callables in a distinct PID, real parse/verify calls, exception transport, timeout cleanup, and descendant-process termination.

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.

Windows: parse/verify fail with timeout wrapper (AttributeError on local function pickling)

1 participant