Skip to content

Commit

Permalink
AsyncContext completion attempt after AsyncListener.onError is called e…
Browse files Browse the repository at this point in the history
…clipse-ee4j#5675

Signed-off-by: Jorge Bescos Gascon <[email protected]>
  • Loading branch information
jbescos committed Oct 18, 2024
1 parent ff5f5a8 commit 29f9ef0
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,18 @@ public OutputStream getOutputStream(final int contentLength) throws IOException

} catch (final Throwable ex) {
if (response.isCommitted()) {
/**
* We're done with processing here. There's nothing we can do about the exception so
* let's just log it.
*/
LOGGER.log(Level.SEVERE, LocalizationMessages.ERROR_WRITING_RESPONSE_ENTITY(), ex);
if (ex.getCause() instanceof IOException) {
skipFinally = true;
LOGGER.log(Level.WARNING, "Response was sent, but there is IO issue", ex);
// Connection is broken. Re-throw to the web container to remove the connection.
throw new MappableException("Response was sent, but there is IO issue", ex);
} else {
/**
* We're done with processing here. There's nothing we can do about the exception so
* let's just log it.
*/
LOGGER.log(Level.SEVERE, LocalizationMessages.ERROR_WRITING_RESPONSE_ENTITY(), ex);
}
} else {
skipFinally = true;
if (ex instanceof RuntimeException) {
Expand Down

0 comments on commit 29f9ef0

Please sign in to comment.