Commit 150e74a
authored
fix: improve telemetry worker stderr cleanup (#3648)
* fix: improve telemetry worker stderr cleanup to prevent hanging
Replace setImmediate + destroy() with process.stderr.end() callback
to ensure all buffered writes are flushed before exiting. Add fallback
exit in finally block to prevent worker from hanging if end() fails.
This properly releases the inherited stderr file descriptor in debug
mode, preventing the parent process from being blocked.
* fix: only close stderr in telemetry worker when DEBUG is active
Only call process.stderr.end() when DEBUG env var is set, mirroring the
parent process logic where stderr is inherited only in DEBUG mode. When
stderr is ignored, closing it is unnecessary and could cause issues.1 parent ede6655 commit 150e74a
1 file changed
+16
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
22 | 21 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
27 | 33 | | |
28 | | - | |
| 34 | + | |
29 | 35 | | |
30 | | - | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | 39 | | |
| |||
0 commit comments