Stack trace dump during "natural" TCP server socket recycling could be suppressed
justparking opened this issue · 0 comments
justparking commented
For example, the following stack-trace might cause unnecessary alarm for someone reading it.
Unexpected exception occurred, pulling down channel server.
Mar 25 06:25:03 ndl-_____ jsvc.exec[770]: java.net.SocketException: Broken pipe (Write failed)
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:111)
at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
at org.nodel.diagnostics.CountableOutputStream.write(CountableOutputStream.java:83)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221)
at sun.nio.cs.StreamEncoder.implFlushBuffer(StreamEncoder.java:291)
at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:295)
at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
at org.nodel.core.TCPChannelServer.doSendMessage(TCPChannelServer.java:342)
at org.nodel.core.TCPChannelServer.processOutgoingMessageQueue(TCPChannelServer.java:195)
at org.nodel.core.TCPChannelServer.access$100(TCPChannelServer.java:27)
at org.nodel.core.TCPChannelServer$2.run(TCPChannelServer.java:128)
at java.lang.Thread.run(Thread.java:748)
The condition "naturally" occurs if a TCP connection to the server port recycles say, due to another nodel server rebooting, etc.
INFO level could be used instead of WARN and just the message included instead of an entire stack dump.
In the same file, TCPChannelServer.java, there is actually a related error which could also treated the same as above.
this._logger.info("Unexpected exception occurred; this may be natural. Pulling down channel server.", exc);