• Post Reply Bookmark Topic Watch Topic
  • New Topic

ClientAbortException - when do multiple request at same time  RSS feed

 
stshiva raaj
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i do simultaneous http request(monkey clicks) is made on the web application i am getting following exception like

Jul 9, 2012 11:05:23 PM org.apache.catalina.core.StandardContextValve throwable
WARNING: Exception Processing ErrorPage[exceptionType=org.apache.jasper.JasperException, location=/jsp/content/utils/error.jsp]
ClientAbortException: java.net.SocketException: Broken pipe
at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:333)
at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:299)

Cause : The warning log basically means that the connection to the client browser is aborted before the response is fully transferred. It is a harmless warning as it can be due to transient network problems or the browser aborts/refreshes the page before it loaded.

Is there any specific configuration in tomcat(sever side) to solve the problem? Please help me

 
Sabarish Venkat
Ranch Hand
Posts: 136
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To my point of view am understanding that you are trying to send multiple requests on a shared resource. In such case You have to make the servlets synchronized , So try to synchronize your threads before sending it to container.
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey! I am not a monkey! I just have spastic fingers. Also a jumpy nerve in my shoulder that can do a lot worse than just double-click, alas!

HTTP requests are serviced asynchronously and independently. There's no real way for the webapp server to objectively determine whether those 2 overlapping requests are legitimate or not. In fact, the requests won't even overlap initially, since (usually!) one comes in first, then the "monkey click" arrives a few milliseconds afterwards.

You can safely ignore the error message, and as I said, it's not really anything you can do anything about.

On the other hand, the application should be making allowances for possibly servicing the request twice, because that could potentially cause trouble. Especially when payments are being made.

The usual way of "handling" that is to warn people no to click more than once, but that's lazy and sloppy and doesn't take into account that people have been conditioned to double-click to do things or that they may have hair-trigger reflexes, like me.

You can try to reduce that problem by adding JavaScript on the client page, but there are limits to how well that works. What I recommend is that critical requests carry a token so that if the same request appears at the server twice, the duplicate token is recognized and processing adjusted accordingly. Effective use of database transactions is usually a critical part of this process.
 
stshiva raaj
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. ... My thought is request is committed while flush the response i made another one request. Even though i synchronize the request(queue the request), while render the response i am getting exception. Typical example is session, I am have different context with same session id. When i do many click in different context session id is same but session values is getting changed.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!