Dan Haywood created ISIS-2071:
---------------------------------

             Summary: Backport suppression of "client connection abort" errors 
from v2
                 Key: ISIS-2071
                 URL: https://issues.apache.org/jira/browse/ISIS-2071
             Project: Isis
          Issue Type: Improvement
            Reporter: Dan Haywood
             Fix For: 1.18.0


In ResourceCachingFilter.
 
{code:java}
    ...

    // try to suppress java.io.IOException of kind 'client connection abort'
    // 1) the TCP protocol (by design) does not provide a means to check, 
whether a
    //    connection has been closed by the client
    // 2) the exception thrown and the exception message text are specific to 
the
    //    servlet-engine implementation, so we can only guess here
    try {
        chain.doFilter(servletRequest, servletResponse);    
    } catch (IOException e) {
        FluentException.of(e)
        .suppressIf(this::isConnectionAbortException);
    }
}

// -- HELPER

private boolean isConnectionAbortException(IOException e) {
    // tomcat 9
    if(e.getMessage().contains("An established connection was aborted by the 
software in your host machine")) {
        return true;
    }
    // payara 4
    if(e.getMessage().contains("Connection is closed")) {
        return true;
    }

    return false;
}
{code}
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to