You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by jo...@apache.org on 2024/05/27 09:08:41 UTC

(sling-org-apache-sling-engine) branch SLING-12326-socketExceptions created (now c842710)

This is an automated email from the ASF dual-hosted git repository.

joerghoh pushed a change to branch SLING-12326-socketExceptions
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-engine.git


      at c842710  SLING-12326 remove the special handling for SocketExceptions

This branch includes the following new commits:

     new c842710  SLING-12326 remove the special handling for SocketExceptions

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(sling-org-apache-sling-engine) 01/01: SLING-12326 remove the special handling for SocketExceptions

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

joerghoh pushed a commit to branch SLING-12326-socketExceptions
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-engine.git

commit c842710a8117f5841d214c1609e5090491267eb5
Author: Joerg Hoh <jo...@apache.org>
AuthorDate: Mon May 27 11:08:27 2024 +0200

    SLING-12326 remove the special handling for SocketExceptions
---
 .../engine/impl/SlingRequestProcessorImpl.java     | 30 ++++++++++++----------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/src/main/java/org/apache/sling/engine/impl/SlingRequestProcessorImpl.java b/src/main/java/org/apache/sling/engine/impl/SlingRequestProcessorImpl.java
index ab47cf5..1061b2d 100644
--- a/src/main/java/org/apache/sling/engine/impl/SlingRequestProcessorImpl.java
+++ b/src/main/java/org/apache/sling/engine/impl/SlingRequestProcessorImpl.java
@@ -280,21 +280,23 @@ public class SlingRequestProcessorImpl implements SlingRequestProcessor {
             handleError(HttpServletResponse.SC_NOT_FOUND, fnfe.getMessage(), request, response);
 
         } catch (final IOException ioe) {
-            // unwrap any causes (Jetty wraps SocketException in EofException)
-            Throwable cause = ioe;
-            while (cause.getCause() != null) {
-                cause = cause.getCause();
-            }
-
-            if (cause instanceof SocketException) {
-                // if the cause is a SocketException, the client most
-                // probably aborted the request, we do not fill the log with errors
-                log.debug("service: Socketexception (Client abort or network problem", ioe);
+            /**
+             * handle all IOExceptions the same way; remember that there could be 2 major
+             * types of IOExceptions 
+             * * exceptions thrown by the rendering process because it
+             * does I/O 
+             * * exceptions thrown by the servlet engine when the connectivity to
+             * the requester is problematic
+             * 
+             * the second case does not need a proper error handling as the requester won't
+             * see the result of it anyway, and for that case also the logging is not
+             * helpful and should be limited to a minimum (if at all).
+             * 
+             * But to ease the code and to provide a proper error handling for the
+             * first case, both types are treated equally here.
+             */
+            handleError(requestData, "IOException", ioe, request, response);
 
-            } else {
-                // otherwise call error handler with original exception
-                handleError(requestData, "IOException", ioe, request, response);
-            }
         } catch (final Throwable t) {
             handleError(requestData, "Throwable", t, request, response);