Have you ran it with 2.9?
On Aug 2, 2017 11:40 PM, "Kohei Tamura (JIRA)" <[email protected]> wrote:
[ https://issues.apache.org/jira/browse/LOG4J2-1922?page=
com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kohei Tamura updated LOG4J2-1922:
---------------------------------
Affects Version/s: (was: 2.7)
2.3
> SocketHandler leaks connection if EOFException is thrown
> --------------------------------------------------------
>
> Key: LOG4J2-1922
> URL: https://issues.apache.org/jira/browse/LOG4J2-1922
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.3
> Reporter: Kohei Tamura
>
> SocketHandler should close the input stream in the finally block.
> {code:title=TcpSocketServer.java|borderStyle=solid}
> /**
> * Thread that processes the events.
> */
> private class SocketHandler extends Thread {
> private final T inputStream;
> private volatile boolean shutdown = false;
> public SocketHandler(final Socket socket) throws IOException {
> this.inputStream = logEventInput.wrapStream(
socket.getInputStream());
> }
> @Override
> public void run() {
> boolean closed = false;
> try {
> try {
> while (!shutdown) {
> logEventInput.logEvents(inputStream,
TcpSocketServer.this);
> }
> } catch (final EOFException e) {
> closed = true;
> } catch (final OptionalDataException e) {
> logger.error("OptionalDataException eof=" + e.eof + "
length=" + e.length, e);
> } catch (final IOException e) {
> logger.error("IOException encountered while reading
from socket", e);
> }
> if (!closed) {
> try {
> inputStream.close();
> } catch (final Exception ex) {
> // Ignore the exception;
> }
> }
> } finally {
> handlers.remove(Long.valueOf(getId()));
> }
> }
> public void shutdown() {
> this.shutdown = true;
> interrupt();
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)