You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andrew Pietsch <an...@forge.com.au> on 2004/10/25 09:07:28 UTC

ClientAbortExceptions and AbstractEngine.exception-during-cleanup

Hi,

We've been experiencing problems when opening new browser windows 
displaying tapestry content.  Initally I thought it was my fault but I 
now think it may be a bug in AbstractEngine.  The problem arises when 
the browser closes the connection early (for reasons unkown) and 
AbstractEngine attempts to flush the output.   We are using version 
3.0.  The existing code from AbstractEngine is as follows (starting at 
line 912):

try
{
   cycle.cleanup();

   // Closing the buffered output closes the underlying stream as well.

   if (output != null)
      output.forceFlush();

   cleanupAfterRequest(cycle);
}
catch (Exception ex)
{
   reportException(Tapestry.getMessage("AbstractEngine.exception-during-cleanup"), ex);
}


The ClientAbortException that's occuring during output.forceFlush() 
results cleanup being skiped.  Since cleanupAfterRequest(..) resets the 
page recorders, we have been getting "Page changed while locked" errors 
the next time the page is visited.

Changing the above code to the following seems to have fixed the problem.

try
{
   cycle.cleanup();

   try
   {
      // Closing the buffered output closes the underlying stream as well.
      
      if (output != null)
         output.forceFlush();
   }
   finally
   {
      cleanupAfterRequest(cycle);
   }
}
catch (Exception ex)
{
   reportException(Tapestry.getMessage("AbstractEngine.exception-during-cleanup"), ex);
}


Is this a bug? 

Cheers
Andrew

-- 
Andrew Pietsch
Forge Research Pty Ltd
Suite 116, Bay 9, Locomotive Workshop
Australian Technology Park, Cornwallis Street
Eveleigh NSW 1430 Australia
Phone: +61 2 9209 4152 Fax: +61 2 9209 4172
www.forge.com.au

******************************************************************
This message contains privileged and confidential information intended
only for the use of the addressee named above. If you are not the
intended recipient of this message you must not disseminate, copy or
take any action in reliance on it. If you have received this message
in error please notify the sender immediately. Any views expressed in
this message are those of the individual sender, except where the
sender specifically states them to be the views of another (including
a Body Corporate).
If you wish to opt out from future messages, send an email to
unsubscribe@forge.com.au with the subject UNSUBSCRIBE
******************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org