You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@tomaszhlawiczka I think this is happening because you use the same pipe end for the uglifyjs output and the cat jquery-3.3.1.min.js output. Node.js sets its stdio pipe ends into non-blocking mode to work with async I/O, but cat expects blocking pipes.
I can’t be for sure because it doesn’t reproduce locally, but does it help if you add | cat after the 2>/dev/null bit, to pass the output of uglifyjs from a non-blocking through to a blocking pipe end?
Node.js creates a net.Socket backed by a uv_pipe_t when the stdio fd refers to a pipe. Libuv cannot dup() the fd, that might break existing programs, but Node.js could.
Activity
addaleax commentedon Apr 5, 2018
@tomaszhlawiczka I think this is happening because you use the same pipe end for the
uglifyjsoutput and thecat jquery-3.3.1.min.jsoutput. Node.js sets its stdio pipe ends into non-blocking mode to work with async I/O, butcatexpects blocking pipes.I can’t be for sure because it doesn’t reproduce locally, but does it help if you add
| catafter the2>/dev/nullbit, to pass the output ofuglifyjsfrom a non-blocking through to a blocking pipe end?tomaszhlawiczka commentedon Apr 5, 2018
@addaleax thanks for reply!
(cat jquery-migrate-3.0.1.js | uglifyjs 2>/dev/null | cat; cat jquery-3.3.1.min.js)|(cat - >/dev/null)- using additional| catseems to work :-)Thanks!
gireeshpunathil commentedon Apr 6, 2018
link #18446
tomaszhlawiczka commentedon Apr 6, 2018
It turns out that the issue should be addressed by
bashteam, right?This bug is such an evil: who knows, writing pipe lines, which app sets
FIONBIOand which does not.addaleax commentedon Apr 6, 2018
Hm, actually – what libuv does for TTYs is calling
dup()on the fd so that it making it nonblocking doesn’t affect other programs.Maybe we should do the same thing for pipes? /cc @nodejs/libuv
bnoordhuis commentedon Apr 6, 2018
Node.js creates a
net.Socketbacked by auv_pipe_twhen the stdio fd refers to a pipe. Libuv cannot dup() the fd, that might break existing programs, but Node.js could.gireeshpunathil commentedon May 31, 2018
This issue has been resolved via #20592 and I have verified with the supplied test programs.
produced the error:
cat: write error: Resource temporarily unavailablea hundred times in thousand iterations, but with the fix none.
Closing this, fix will be mostly available in the next current release.
gireeshpunathil commentedon Jun 12, 2018
#20592 was reverted in master, so re-opening this.
apapirovski commentedon Nov 29, 2018
I'm going to close this out given that it seems this might've gotten fixed again in another PR, and even if not there's not much progress here.
gireeshpunathil commentedon Nov 29, 2018
FWIW, #24260 is the rework.