[MGNLDMS-185] DMSDownloadServlet logs error messages on client abort Created: 17/May/10  Updated: 04/Nov/15  Resolved: 04/Nov/15

Status: Closed
Project: Document Management System (closed)
Component/s: None
Affects Version/s: 1.4.3
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Oliver Siegmar Assignee: Philipp Bärfuss
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Tomcat 6.0.26


Attachments: Text File DMSDownloadServlet.java.patch    
Issue Links:
relation
is related to MGNLDMS-106 DMSDownloadServlet - error during dow... Closed
is related to MAGNOLIA-3855 h.264 (mp4) video in a html 5 video t... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

The DMSDownloadServlet logs error messages on client abort -

2010-05-15 00:00:07,261 ERROR info.magnolia.module.dms.DMSDownloadServlet - error during download
ClientAbortException:  java.net.SocketException: Connection reset
        at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)
        at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434)
        at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349)
        at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:381)
        at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:370)
        at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
        at info.magnolia.module.dms.DMSDownloadServlet.sendUnCompressed(DMSDownloadServlet.java:124)
        at info.magnolia.module.dms.DMSDownloadServlet.handleResourceRequest(DMSDownloadServlet.java:109)
        at info.magnolia.module.dms.DMSDownloadServlet.process(DMSDownloadServlet.java:185)
        at info.magnolia.module.dms.DMSDownloadServlet.doGet(DMSDownloadServlet.java:75)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at info.magnolia.cms.filters.ServletDispatchingFilter.doFilter(ServletDispatchingFilter.java:183)

...

This has once been fixed in MGNLDMS-106 but we now have a regression - probably due to a exception change in recent tomcat versions. Tomcat (using 6.0.26 here) doesn't throw a SocketException, but a ClientAbortException (which is an IOException).

I'd suggest to catch the IOException rather then the SocketException in DMSDownloadServlet.



 Comments   
Comment by Matt Dertinger [ 25/Oct/11 ]

Hi,

I've attached a patch that uses a slightly modified version of the code provided by Danilo at MAGNOLIA-3566. It just adds another catch block for IOException then inspects the cause to see if it was a ClientAbortException. Code snippet below just for reference:

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        try {
            process(request, response);
        }
        catch (IOException ioe) {
            Throwable wrappedException = ExceptionUtils.getCause(ioe);
            if (!((wrappedException != null) && (StringUtils.equalsIgnoreCase(ioe.getClass().getName(),
                "org.apache.catalina.connector.ClientAbortException")))) {
                // log error message ONLY if it's not a client abort.
                log.error("IOExeption during download", ioe);
            } else {
                log.debug("ClientAbortException during download");
            }
        }
        catch (Exception e) {
            log.error("error during download", e);
        }
    }

Let me know if you have any questions.

Cheers,
Matt

Comment by Michael Mühlebach [ 04/Nov/15 ]

Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes.
Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement.
I'm going to close this to set expectations so the issue doesn't stay open for years with few updates. If the issue is still relevant please feel free to reopen it or create a new issue.

Generated at Mon Feb 12 00:49:15 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.