You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/10/22 07:39:00 UTC

[jira] [Commented] (LOG4J2-2829) TcpSocketManager.write swallows IOException when retry = false or reconnector != null

    [ https://issues.apache.org/jira/browse/LOG4J2-2829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17432843#comment-17432843 ] 

ASF subversion and git services commented on LOG4J2-2829:
---------------------------------------------------------

Commit 33be70406043ad436773500829c148e00a4fb1a6 in logging-log4j2's branch refs/heads/LOG4J2-2829 from Volkan Yazici
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=33be704 ]

LOG4J2-2829 SocketAppender should propagate failures when reconnection fails.


> TcpSocketManager.write swallows IOException when retry = false or reconnector != null
> -------------------------------------------------------------------------------------
>
>                 Key: LOG4J2-2829
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2829
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.12.1
>            Reporter: Mihail
>            Priority: Major
>
> Hi, I see very stange behavior when using tcp SocketAppender. My configuration is:
> <Socket name="auditSocket" protocol="TCP" host="10.8.84.194" port="4587" connectTimeoutMillis="10000" reconnectionDelayMillis="10000"
>  immediateFail="true" immediateFlush="true" ignoreExceptions="false" bufferedIO="false">
> After application starts and before writing any logs I simulate connection reset with:
> iptables -A OUTPUT -p tcp -d 10.8.84.194 --dport 4587 -j REJECT --reject-with tcp-reset
> Now the strange part:
>  # First log is written to output stream successfully (but nothing actually gets sent)
>  # Second log throws IOException on outputstream write, this gets handled with a reconnection attempt (which fails) and result is AppenderLoggingException - this is what I expect because I'm using a failover appender to route the log into file.
>  # Third and subsequent log attempts also fail due to IOException on outputstream write BUT no AppenderLoggingException is raised - reconnector is not null at this point and IOException gets swallowed up.
>  
> I'm using log4j2 2.12.1
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)