Bug 46324 - SocketNode does not close socket when ending
Summary: SocketNode does not close socket when ending
Status: RESOLVED DUPLICATE of bug 42585
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: 1.2
Hardware: PC Windows XP
: P2 major
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-02 10:02 UTC by Jon Osborn
Modified: 2009-01-08 09:34 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Osborn 2008-12-02 10:02:11 UTC
In org.apache.log4j.net.SocketNode, the code does not close the socket when the objectinputstream has an error.

This block attempts to close the objectinputstream:

    try {
      ois.close();
    } catch(Exception e) {
      logger.info("Could not close connection.", e);
    }

if the objectinputstream is null, however, socket.close() is never called thus leaking a socket.

Pls add

    try {
      socket.close();
    } catch(Exception e) {
      logger.info("Could not close socket.", e);
    }


to the end of run() in org.apache.log4j.net.SocketNode
Comment 1 Curt Arnold 2009-01-08 09:34:51 UTC

*** This bug has been marked as a duplicate of bug 42585 ***