Request thread is blocking by AbstractCommmunicatationManger class

In my application I am using vaadin 6.3.

I am facing thread (request) blocking at following point (in vaadin) when user request through web browser and close browser before reply come back.

com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest (line: 567)

What should I do to resolve this problem?

Hi,

Could you be a little more specific on where the blocking occurs? Line 567 synchronizes on application to prevent multiple threads from modifying the application state at the same time but by itself does not block anything. If the user aborts the request it should still be processed normally and the servlet exits the synchronization block and allows the next request to the same application to the processed.

I have also seen code and confused that line 567 is used for preventing multiple threads for modify application state.
But I am using Lamda Probe as Apache Tomcat monitoring tool. Which tells me that few thread are blocked at this line.
It shows me following log.



com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest ( AbstractCommunicationManager.java:567 )
com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest ( CommunicationManager.java:265 )
com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service ( AbstractApplicationServlet.java:484 )
com.eitl.automation.vaadin.spring.servlet.SpringApplicationServlet.service ( SpringApplicationServlet.java:78 )
javax.servlet.http.HttpServlet.service ( HttpServlet.java:717 )
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter ( ApplicationFilterChain.java:290 )
org.apache.catalina.core.ApplicationFilterChain.doFilter ( ApplicationFilterChain.java:206 )
org.apache.catalina.core.StandardWrapperValve.invoke ( StandardWrapperValve.java:233 )
org.apache.catalina.core.StandardContextValve.invoke ( StandardContextValve.java:191 )
org.apache.catalina.core.StandardHostValve.invoke ( StandardHostValve.java:128 )
org.jstripe.tomcat.probe.Tomcat55AgentValve.invoke ( Tomcat55AgentValve.java:20 )
org.apache.catalina.valves.ErrorReportValve.invoke ( ErrorReportValve.java:102 )
org.apache.catalina.authenticator.SingleSignOn.invoke ( SingleSignOn.java:394 )
org.apache.catalina.core.StandardEngineValve.invoke ( StandardEngineValve.java:109 )
org.apache.catalina.connector.CoyoteAdapter.service ( CoyoteAdapter.java:293 )
org.apache.coyote.http11.Http11Processor.process ( Http11Processor.java:849 )
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process ( Http11Protocol.java:583 )
org.apache.tomcat.util.net.JIoEndpoint$Worker.run ( JIoEndpoint.java:454 )
java.lang.Thread.run ( Thread.java:619 )

May be it will block after this line.

If one thread is inside the synchronized block then the others will block at that line and wait for the executing thread to finish the synchronized block. The question then becomes: what is the thread executing inside the synchronized block doing?

Note that the threads are all then UIDL requests for the same Application i.e. for the same user and session which sound a bit strange. It is completely possible that some threads are waiting for another thread (that’s the whole point of the synchronized block) but the threads should then continue after a short while (when the executing thread is done).

Let me check log & thread status once again.

But can I get vaadin’s internal log? It will help me trace out the problem.
Also I am trying latest version of vaadin with my existing application.

Also, my application is broadcasting data to all other clients after processing request. May this feature invite thread blocking problem?

Problem has resolved when I have changed my Tomcat from 6.20 to 6.29. :huh: