| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
@felixweinberger is there a way to add a test for this?
Sorry, something went wrong.
Yes accidentally pushed as non-draft and planning to test on a Windows VM - working on this atm. |
Sorry, something went wrong.
Add comprehensive test suite for Windows-specific FallbackProcess to verify that CTRL_C_EVENT signal properly triggers cleanup code in lifespan context managers. These tests will fail until issue #1027 is fixed. Includes detailed documentation explaining why the metaprogramming approach is necessary for testing OS-level signal handling between processes. Tests include: - Graceful shutdown with CTRL_C_EVENT signal - Timeout fallback to terminate() when signal is ignored - CTRL_C_EVENT availability verification - Async stdio stream functionality Uses @pytest.mark.skipif pattern consistent with codebase conventions. Github-Issue:#1027
Implement proper graceful shutdown for Windows subprocesses by sending CTRL_C_EVENT signal before termination. This allows cleanup code in lifespan context managers to execute properly. The fix addresses issue #1027 where cleanup code after yield statements was not being executed on Windows due to forceful process termination. Changes: - Send CTRL_C_EVENT signal for graceful shutdown on Windows - Wait up to 2 seconds for process to exit gracefully - Fall back to terminate() if graceful shutdown fails - Add terminate_windows_process() helper function Github-Issue:#1027 Reported-by:Felix Weinberger
| Back | FazBrowse Home | New Git URL |
Summary
Problem
On Windows, the cleanup procedure after yield in the lifespan context manager was not executed because process.terminate() forcefully killed processes without allowing cleanup code to run. This prevented proper resource cleanup and graceful shutdown of MCP servers on Windows.
Solution
Modified the Windows process termination logic to:
The fix is applied to both:
Technical Details
Test Plan
Related Issues