Subject: | Net-Jabber consumes all CPU when EPIPE (Broken pipe) occurs during write |
I'm using a simple script that uses Net::Jabber to connect to a Jabber server using a dedicated account and send a notification message to another user. Occasionally, the script hangs and starts consuming all CPU.
When I do a "strace -p PID" on the running script's process, I can see that it tries to write (apparently to a PIPE) all the time, and receives a "Broken pipe" error, but ignores it and tries writing in an infinite loop:
getpid() = 4596
write(6, "\27\3\1\0000T\321f\231\240\304\317/b\205r\217^km\26\246"..., 53) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
getpid() = 4596
write(6, "\27\3\1\0000T\321f\231\240\304\317/b\205r\217^km\26\246"..., 53) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
getpid() = 4596
write(6, "\27\3\1\0000T\321f\231\240\304\317/b\205r\217^km\26\246"..., 53) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
getpid() = 4596
write(6, "\27\3\1\0000T\321f\231\240\304\317/b\205r\217^km\26\246"..., 53) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
getpid() = 4596
write(6, "\27\3\1\0000T\321f\231\240\304\317/b\205r\217^km\26\246"..., 53) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
getpid() = 4596
write(6, "\27\3\1\0000T\321f\231\240\304\317/b\205r\217^km\26\246"..., 53) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
getpid() = 4596
write(6, "\27\3\1\0000T\321f\231\240\304\317/b\205r\217^km\26\246"..., 53) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
getpid() = 4596
write(6, "\27\3\1\0000T\321f\231\240\304\317/b\205r\217^km\26\246"..., 53) = -1 EPIPE (Broken pipe)