Commit 57b0fd1
fix: handle TimeoutError in Actor __aexit__ to prevent resource leaks
When Actor cleanup exceeded `_cleanup_timeout`, the unhandled
`TimeoutError` from `asyncio.wait_for` left the Actor in a broken
state: `_is_initialized` was never reset, event/charging managers
were left partially shut down, and `sys.exit()` was never called.
Now the timeout is caught and critical resource cleanup (event manager,
charging manager) is attempted even after timeout. `_is_initialized`
is reset in a `finally` block to guarantee consistent state.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 56aa42e commit 57b0fd1
1 file changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
256 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
257 | 266 | | |
258 | 267 | | |
259 | 268 | | |
| |||
0 commit comments