Commit 5012672
Make FallbackProcess cleanup more robust with try-except
- Keep process termination in __aexit__ but wrap in try-except
- Use non-blocking wait with short timeout (0.5s) to prevent hangs
- Catch ProcessLookupError and OSError for already-dead processes
- Still clean up all streams regardless of termination success
This approach is more conventional for a context manager while preventing
failures when the process is already being handled by stdio_client's
cleanup sequence or has already terminated.
Reported-by: Felix Weinberger
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent d6f1264 commit 5012672
2 files changed
+13
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
81 | 91 | | |
82 | 92 | | |
83 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
160 | | - | |
161 | 159 | | |
162 | 160 | | |
163 | 161 | | |
| |||
166 | 164 | | |
167 | 165 | | |
168 | 166 | | |
169 | | - | |
170 | 167 | | |
171 | 168 | | |
172 | 169 | | |
| |||
0 commit comments