Commit 7eb8ad0
committed
bugfix: ngx.pipe waits until timeout because child process forgot to close pipe after dup2.
After the fork, the pipe will be copied by dup2, so there are two fd for the same open file description.
eg: 0, 11 for the same pipe file, 1, 13 for another pipe file.
When running a short life process, the fd will be closed automatically when the process exits.
When running a daemon process, the daemon may close fd 0, fd 1 and redirect them to /dev/null,
but left the fd 11 and fd 13 opened forever.
when ngx.pipe reads from the pipe, it will wait for reading until the pipe is closed or timeout.
Because the daemon won't close the pipe, so ngx.pipe will wait for the timeout.1 parent 30debf6 commit 7eb8ad0
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
776 | 782 | | |
777 | 783 | | |
778 | 784 | | |
| |||
0 commit comments