When using Undertow (Wildfly or JBoss) with HTTP2 in conjunction with JSF applications, numerous instances of java.nio.channels.ClosedChannelException are logged. This issue appears to be related to how HTTP2 handles resource loading, particularly when interacting with different web browsers such as Chrome and Firefox.
Reproducer (vary slightly between Chrome and Firefox)
Chrome:
Open any JSF application page
Before the page fully loads, refresh (F5) or close the page.
Observe that java.nio.channels.ClosedChannelException is logged on the server.
Firefox:
Open any JSF application page, refresh the page (ensuring that the Firefox cached resources)
Note that each request for resource loading results in java.nio.channels.ClosedChannelException.
The issue disappears when Firefox's cache is disabled, indicating a potential link with Firefox's caching mechanism.
Environment
WildFly30 (using Undertow 2.3.10.Final)
HTTP2 enabled
Any JSF application
The issue seems to be more pronounced in Firefox, where every resource load request triggers the exception, potentially pointing towards a handling problem in the interaction between HTTP2, browser caching mechanisms, and resource loading in JSF applications.
Regarding Firefox (my assumptions): The exception occurs if Firefox sends a request to the server to load a resource, then finds out that it can retrieve the resource from the cache and interrupts the request, leading to a ClosedChannelException in Undertow.
Description
When using Undertow (Wildfly or JBoss) with HTTP2 in conjunction with JSF applications, numerous instances of java.nio.channels.ClosedChannelException are logged. This issue appears to be related to how HTTP2 handles resource loading, particularly when interacting with different web browsers such as Chrome and Firefox.
Reproducer (vary slightly between Chrome and Firefox)
Chrome:
Firefox:
Environment
The issue seems to be more pronounced in Firefox, where every resource load request triggers the exception, potentially pointing towards a handling problem in the interaction between HTTP2, browser caching mechanisms, and resource loading in JSF applications.
Regarding Firefox (my assumptions): The exception occurs if Firefox sends a request to the server to load a resource, then finds out that it can retrieve the resource from the cache and interrupts the request, leading to a ClosedChannelException in Undertow.
Possible solution (?): The class ResourceHandlerImpl skips ClientAbortException (Tomcat) and EofException (Jetty) in method isConnectionAbort: https://github.com/eclipse-ee4j/mojarra/blob/350fbbea7fe3b2c02eb416934cdebb2c0f9830da/impl/src/main/java/com/sun/faces/application/resource/ResourceHandlerImpl.java#L346 Maybe ClosedChannelException (undertow) should be handled the same way?
the stacktrace is attached stacktrace.log