Commit 74452d1
committed
fix(fs-watcher): prevent watchdog threads from blocking process exit on Windows and daemon shutdown
- Force watchdog observer and internal threads to daemon mode after startup to ensure non-blocking exit behavior
- Replace blocking stop/join sequence with timeout-safe shutdown that cannot stall sys.exit()
- Harden fs_watcher.stop() with defensive exception handling and guaranteed cleanup of shared memory flag
- Ensure worker daemon shutdown path fully releases fs_watcher reference to avoid lingering observer lifecycle
- Improve robustness of fs_watcher lifecycle under Windows thread scheduling and shutdown races
This fixes cases where file system watcher threads kept the process alive indefinitely during shutdown, especially under Windows and long-running daemon sessions.
Modified:
• src/omnipkg/isolation/fs_watcher.py (+37/-17 lines)
• src/omnipkg/isolation/worker_daemon.py (+26/-6 lines)
[gitship-generated]1 parent 3071213 commit 74452d1
2 files changed
Lines changed: 63 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
982 | 1002 | | |
983 | 1003 | | |
984 | 1004 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3205 | 3205 | | |
3206 | 3206 | | |
3207 | 3207 | | |
3208 | | - | |
3209 | | - | |
| 3208 | + | |
| 3209 | + | |
| 3210 | + | |
| 3211 | + | |
| 3212 | + | |
| 3213 | + | |
3210 | 3214 | | |
3211 | | - | |
3212 | | - | |
| 3215 | + | |
| 3216 | + | |
| 3217 | + | |
3213 | 3218 | | |
3214 | | - | |
| 3219 | + | |
| 3220 | + | |
| 3221 | + | |
| 3222 | + | |
| 3223 | + | |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
3215 | 3234 | | |
3216 | 3235 | | |
3217 | 3236 | | |
| |||
4927 | 4946 | | |
4928 | 4947 | | |
4929 | 4948 | | |
4930 | | - | |
| 4949 | + | |
4931 | 4950 | | |
4932 | 4951 | | |
4933 | 4952 | | |
4934 | 4953 | | |
| 4954 | + | |
4935 | 4955 | | |
4936 | 4956 | | |
4937 | 4957 | | |
| |||
0 commit comments