[logback-dev] [JIRA] Updates for LOGBACK-1557: An exception is thrown when AbstractServerSocketAppender is being stopped
QOS.CH (JIRA)
noreply-jira at qos.ch
Sat May 15 15:23:00 CEST 2021
logback / LOGBACK-1557 [Open]
An exception is thrown when AbstractServerSocketAppender is being stopped
==============================
Here's what changed in this issue in the last few minutes.
This issue has been created
This issue is now assigned to you.
View or comment on issue using this link
https://jira.qos.ch/browse/LOGBACK-1557
==============================
Issue created
------------------------------
Cezary Regec created this issue on 15/May/21 3:11 PM
Summary: An exception is thrown when AbstractServerSocketAppender is being stopped
Issue Type: Bug
Affects Versions: 1.0.13, 1.1.0, 1.1.1, 1.1.10, 1.1.11, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.3.0-alpha0, 1.3.0-alpha1, 1.3.0-alpha3, 1.3.0-alpha4, 1.3.0-alpha5, 1.3.0-alpha6
Assignee: Logback dev list
Components: logback-core
Created: 15/May/21 3:11 PM
Environment:
Tested and this issue on:
- macOS 10.13.16, MacBookPro8,2, Java 11
- Ubuntu 18.04, Java 8 and Java 11
Priority: Major
Reporter: Cezary Regec
Description:
ServerSocketAppender (or any appender using {color:#000000}ConcurrentServerRunner) {color}can emit an error when stopping. This issue is most noticeable in projects where Spring Boot is used, as Spring Boot reloads Logback config when starting and any error that occured during this reload is escalated and crashes the whole app.
*Symptomps*:
An error containing the following message is being reported to StatusManager:
{noformat}
java.net.SocketException: Socket is closed{noformat}
*How to reproduce?*
I have added a simple tests that presents how to reproduce the error:
[https://github.com/multicatch/logback/commit/97aa380c4318d09e688d96a3fd9873558835076e]
*The cause*
This is due to the fact that ConcurrentServerRunner is not being interrupted when it is run by the ExecutionService and it waits for new connections even when it was instructed to stop. Finally, the ServerSocket is closed and the `accept()` method is still waiting for connections (and even if not, the loop in ConcurrentServerRunner is not breaking because the thread with the runner was not interrupted) and it causes the `SocketException`. It is then caught and added to StatusManager, and then crashes Spring Boot as this is treated as configuration error.
I have implemented a fix for this issue ([https://github.com/multicatch/logback/tree/fix/server-socket-closing)] and it can be cherry-picked to all affected versions.
==============================
This message was sent by Atlassian Jira (v8.8.0#808000-sha1:e2c7e59)
More information about the logback-dev
mailing list