History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5440
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: -- --
Assignee: Unassigned
Reporter: Henry Minsky
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Empty XML document causes bad behavior in proxied data loading

Created: 15/Feb/08 12:28 PM   Updated: 04/Mar/08 04:14 PM
Component/s: Server - Data Transport
Affects Version/s: 4.0.5WaffleCone
Fix Version/s: RingDing (4.1), Freya

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive test.zip (1 kb)


Severity: Minor
Fixed in Change#: 8,062
Runtime: N/A
Fix in hand: True, False


 Description  « Hide
If the data coming back from an XML proxied data load request is badly formatted, in particular is an empty file, the server throws an uncaught exception, and the
client is left hanging.

Fix for now is to catch the exception and close the data stream


data.XMLGrabber:

Index: XMLGrabber.java
===================================================================
--- XMLGrabber.java (revision 8041)
+++ XMLGrabber.java (working copy)
@@ -147,12 +147,13 @@
         public void run() {
             try {
                 writeXMLDataToOutputStream();
- pout.flush();
- pout.close();
- } catch (XmlPullParserException ex) {
- throw new RuntimeException(ex);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
+ } catch (Exception e) {
+ } finally {
+ try {
+ pout.flush();
+ pout.close();
+ } catch (Exception e) {
+ }
             }
         }
 


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Henry Minsky - 15/Feb/08 01:31 PM
The test.zip file contains a test.jsp, which returns zero length data. Doing a dataset load from this, as in test.lzx, causes
a hang on the client in proxied mode.

Henry Minsky - 15/Feb/08 06:21 PM
more details about the bug:

Run test.lzx, and click the button to submit the POST data

The client then appears to hang, and sometimes firefox crashes for me on MacOSX.

Looking in the catalina.out from Tomcat shows a stack trace regarding an EOFError from the xml copy thread calling the XMLPULL parser
in org.openlaszlo.data.XMLGrabber.java. This is due the the .jsp file returning zero bytes of data, causing the nextToken() call
to throw an exception, leaving the HTTP output stream hanging.


When I run with LiveHTTPHeaders, I do not see anything printed in the http trace log window, which is weird. It seems like it
hangs until the server closes the connection ,which it never does.

Henry Minsky - 19/Feb/08 12:41 PM
r8062 | hqm | 2008-02-19 15:40:46 -0500 (Tue, 19 Feb 2008) | 37 lines
Changed paths:
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/data/XMLGrabber.java

Change 20080219-hqm-D by hqm@badtzmaru on 2008-02-19 15:39:03 EST
    in /Users/hqm/openlaszlo/trunk/WEB-INF/lps/server/src
    for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/server/src


Summary: make sure LPS server data proxy will close http connection if
errors occur

New Features:

Bugs Fixed: LPP-5440

Technical Reviewer: max
QA Reviewer: pkang
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:

If an ill-formed or empty document causes an error in the XML proxy
server, it can
leave the HTTP connection open, causing hangs on the client.


This forces the stream to close on any error.

I don't know how to easily throw an error asynchronously to the parent
thread in Java, so we are just closing the connection for now.

Tests:

see bug report for test case



Henry Minsky - 19/Feb/08 12:43 PM
This is checked into trunk, not devildog

Max Carlson - 19/Feb/08 12:47 PM
Also fixed in pagan/4.0.10 r8064:

Author: max
Date: 2008-02-19 12:45:57 -0800 (Tue, 19 Feb 2008)
New Revision: 8064

Modified:
   openlaszlo/branches/pagan-deities/
   openlaszlo/branches/pagan-deities/WEB-INF/lps/server/src/org/openlaszlo/data/XMLGrabber.java
Log:
Merged revisions 8062 via svnmerge from
http://svn.openlaszlo.org/openlaszlo/trunk

.......
  r8062 | hqm | 2008-02-19 12:40:46 -0800 (Tue, 19 Feb 2008) | 37 lines
  
  Change 20080219-hqm-D by hqm@badtzmaru on 2008-02-19 15:39:03 EST
      in /Users/hqm/openlaszlo/trunk/WEB-INF/lps/server/src
      for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/server/src
  
  
  Summary: make sure LPS server data proxy will close http connection if
  errors occur
  
  New Features:
  
  Bugs Fixed: LPP-5440
  
  Technical Reviewer: max
  QA Reviewer: pkang
  Doc Reviewer: (pending)
  
  Documentation:
  
  Release Notes:
  
  Details:
  
  If an ill-formed or empty document causes an error in the XML proxy
  server, it can
  leave the HTTP connection open, causing hangs on the client.
  
  
  This forces the stream to close on any error.
  
  I don't know how to easily throw an error asynchronously to the parent
  thread in Java, so we are just closing the connection for now.
  
  Tests:
  
  see bug report for test case
.......



Property changes on: openlaszlo/branches/pagan-deities
___________________________________________________________________
Name: svnmerge-integrated
   - /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-7950,7983,8021
   + /openlaszlo/branches/paperpie:1-6504,6506-6574,6576-7135,7137-7235 /openlaszlo/branches/wafflecone:1-5746,5818-6068,6070-6205,6207-6213,6216-6265,6267-6368,6370-6431,6433-6450,6497,6509,6661,7097,7872 /openlaszlo/trunk:1-7950,7983,8021,8062

Modified: openlaszlo/branches/pagan-deities/WEB-INF/lps/server/src/org/openlaszlo/data/XMLGrabber.java
===================================================================
--- openlaszlo/branches/pagan-deities/WEB-INF/lps/server/src/org/openlaszlo/data/XMLGrabber.java 2008-02-19 20:43:39 UTC (rev 8063)
+++ openlaszlo/branches/pagan-deities/WEB-INF/lps/server/src/org/openlaszlo/data/XMLGrabber.java 2008-02-19 20:45:57 UTC (rev 8064)
@@ -8,7 +8,7 @@
 * ****************************************************************************/
 
 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2001-2008 Laszlo Systems, Inc. All Rights Reserved. *
 * Use is subject to license terms. *
 * J_LZ_COPYRIGHT_END *********************************************************/
 
@@ -147,12 +147,13 @@
         public void run() {
             try {
                 writeXMLDataToOutputStream();
- pout.flush();
- pout.close();
- } catch (XmlPullParserException ex) {
- throw new RuntimeException(ex);
- } catch (IOException ex) {
- throw new RuntimeException(ex);
+ } catch (Exception e) {
+ } finally {
+ try {
+ pout.flush();
+ pout.close();
+ } catch (Exception e) {
+ }
             }
         }
 


_______________________________________________
Laszlo-checkins mailing list
Laszlo-checkins@openlaszlo.org
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Mamye Kratt - 20/Feb/08 01:04 PM
(pagan deities build r8066 freya/4.0.10)
When I run the testfile(test.lzx) and click on the button. The word POST displays and a window with the title Groups and Users opens. Henry confirms this is the correct behavior.

Mamye Kratt - 20/Feb/08 01:04 PM
Need to test in trunk for ringding.

Mamye Kratt - 04/Mar/08 04:14 PM
(trunk build r8155)
Same results as pagan-deities.