Commit 29adb96
fix(gradle): destroy streams on exit to prevent daemon pipe hang
When `execGradleAsync()` spawns Gradle via `execFile` with `shell: true`,
the Gradle daemon inherits the shell's stdout/stderr pipe file descriptors.
After the task completes, the daemon continues running and holds these
pipes open, preventing the shell wrapper from exiting. Since Node.js
resolves the `exit` event based on the shell process terminating, the
Promise hangs indefinitely.
Fix: Forcibly destroy stdout/stderr streams after the `exit` event fires.
By this point all output has been buffered, so no data is lost. Destroying
the streams releases the pipe FDs from Node's perspective, allowing the
shell to exit and the Promise to resolve.
Refs: nodejs/node#5637, gradle/gradle#39871 parent e1e4ac8 commit 29adb96
1 file changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
66 | 77 | | |
67 | 78 | | |
68 | 79 | | |
| |||
0 commit comments