Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sockjs heartbeat failure logged at ERROR level [SPR-15307] #19871

Closed
spring-issuemaster opened this issue Mar 2, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Mar 2, 2017

zyro opened SPR-15307 and commented

when a sockjs heartbeat fails with a SockJsTransportFailureException, it seems the exception just bubbles up and is logged at ERROR level.

however, looks like this exception is also thrown if a client just goes away, which does not qualify as an error condition but should rather be expected.

ref.

would be nice if this condition is just logged at DEBUG not causing that much noise.

the reference url shows a corresponding stackoverflow question. that one is using the tomcat APR connector, it seems but we also get such error logs frequently with the tomcat NIO connector, then it looks like:

2017-03-01 11:14:59.932 ERROR 23697 --- [MessageBroker-2] o.s.s.s.TaskUtils$LoggingErrorHandler    : Unexpected error occurred in scheduled task.

org.springframework.web.socket.sockjs.SockJsTransportFailureException: Failed to write SockJsFrame content='h'; nested exception is org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
                at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame(AbstractSockJsSession.java:338)
                at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.sendHeartbeat(AbstractSockJsSession.java:254)
                at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession$HeartbeatTask.run(AbstractSockJsSession.java:450)
                at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
                at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)

Caused by: org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe
                at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:396)
                at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:426)
                at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:345)
                at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:320)
                at org.apache.catalina.connector.Response.flushBuffer(Response.java:496)
                at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java:318)
                at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:176)
                at org.springframework.boot.context.web.ErrorPageFilter$ErrorWrapperResponse.flushBuffer(ErrorPageFilter.java:321)
                at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:176)
                at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:176)
                at javax.servlet.ServletResponseWrapper.flushBuffer(ServletResponseWrapper.java:176)
                at org.springframework.security.web.context.OnCommittedResponseWrapper.flushBuffer(OnCommittedResponseWrapper.java:143)
                at org.springframework.security.web.context.SaveContextOnUpdateOrErrorResponseWrapper.flushBuffer(SaveContextOnUpdateOrErrorResponseWrapper.java:40)
                at org.springframework.http.server.ServletServerHttpResponse.flush(ServletServerHttpResponse.java:95)
                at org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession.writeFrameInternal(AbstractHttpSockJsSession.java:355)
                at org.springframework.web.socket.sockjs.transport.session.AbstractSockJsSession.writeFrame(AbstractSockJsSession.java:321)
                ... 10 common frames omitted

Caused by: java.io.IOException: Broken pipe
                at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
                at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
                at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
                at sun.nio.ch.IOUtil.write(IOUtil.java:65)
                at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:471)
                at org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:124)
                at org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:101)
                at org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:172)
                at org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer.java:139)
                at org.apache.coyote.http11.InternalNioOutputBuffer.addToBB(InternalNioOutputBuffer.java:197)
                at org.apache.coyote.http11.InternalNioOutputBuffer.access$000(InternalNioOutputBuffer.java:41)
                at org.apache.coyote.http11.InternalNioOutputBuffer$SocketOutputBuffer.doWrite(InternalNioOutputBuffer.java:320)
                at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:118)
                at org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputBuffer.java:256)
                at org.apache.coyote.Response.doWrite(Response.java:491)
                at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:391)
                ... 25 common frames omitted

thanks, zyro


Affects: 4.2.6, 4.3.7

Reference URL: http://stackoverflow.com/questions/42555686/grails-3-2-4-grails-spring-websocket-2-3-error

Referenced from: commits d3324c8, 71852a9

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 16, 2017

Rossen Stoyanchev commented

This should be fixed now, thanks for reporting.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 16, 2017

zyro commented

awesome. thank you for taking care of this one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.