[JBoss JIRA] (WFCORE-1403) UDP Syslog handler cannot log first message after reconnect
by James Perkins (JIRA)
[ https://issues.jboss.org/browse/WFCORE-1403?page=com.atlassian.jira.plugi... ]
James Perkins closed WFCORE-1403.
---------------------------------
Resolution: Rejected
This is working as expected. It's the way that {{java.net.DatagramSocket.send()}} is implemented. The first invocation on a down server doesn't raise and error. The second invocation raises the error and the third invocation works as expected.
> UDP Syslog handler cannot log first message after reconnect
> -----------------------------------------------------------
>
> Key: WFCORE-1403
> URL: https://issues.jboss.org/browse/WFCORE-1403
> Project: WildFly Core
> Issue Type: Bug
> Components: Logging
> Reporter: Ondrej Lukas
> Assignee: James Perkins
> Attachments: logging-deployment.war
>
>
> In case when logging to syslog through UDP protocol is configured and syslog port becomes unreachable then after syslog restart first message can be thrown away. It happens when odd number of messages is attempted to be logged during syslog is unreachable. It is caused when port unreachable is returned during logging attempt, then another log attempt automatically fail even if syslog server has been started meanwhile.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 2 months
[JBoss JIRA] (WFCORE-1403) UDP Syslog handler cannot log first message after reconnect
by James Perkins (JIRA)
[ https://issues.jboss.org/browse/WFCORE-1403?page=com.atlassian.jira.plugi... ]
James Perkins moved WFLY-6242 to WFCORE-1403:
---------------------------------------------
Project: WildFly Core (was: WildFly)
Key: WFCORE-1403 (was: WFLY-6242)
Component/s: Logging
(was: Logging)
> UDP Syslog handler cannot log first message after reconnect
> -----------------------------------------------------------
>
> Key: WFCORE-1403
> URL: https://issues.jboss.org/browse/WFCORE-1403
> Project: WildFly Core
> Issue Type: Bug
> Components: Logging
> Reporter: Ondrej Lukas
> Assignee: James Perkins
> Attachments: logging-deployment.war
>
>
> In case when logging to syslog through UDP protocol is configured and syslog port becomes unreachable then after syslog restart first message can be thrown away. It happens when odd number of messages is attempted to be logged during syslog is unreachable. It is caused when port unreachable is returned during logging attempt, then another log attempt automatically fail even if syslog server has been started meanwhile.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 2 months
[JBoss JIRA] (WFCORE-1401) TCP Syslog handler cannot log some messages after reconnect
by James Perkins (JIRA)
[ https://issues.jboss.org/browse/WFCORE-1401?page=com.atlassian.jira.plugi... ]
James Perkins moved WFLY-6243 to WFCORE-1401:
---------------------------------------------
Project: WildFly Core (was: WildFly)
Key: WFCORE-1401 (was: WFLY-6243)
Component/s: Logging
(was: Logging)
> TCP Syslog handler cannot log some messages after reconnect
> -----------------------------------------------------------
>
> Key: WFCORE-1401
> URL: https://issues.jboss.org/browse/WFCORE-1401
> Project: WildFly Core
> Issue Type: Bug
> Components: Logging
> Reporter: Ondrej Lukas
> Assignee: James Perkins
> Attachments: logging-deployment.war
>
>
> In case when logging to syslog through TCP protocol is configured and syslog port becomes unreachable then after syslog restart some messages can be thrown away.
> It seems syslog handler needs to another two logs for correct closing original TCP connection. In case when syslog is restarted and
> * no message is logged during syslog is unreachable then the first two messages will not be logged to syslog after syslog is running again
> * one message is attempted to be logged during syslog is unreachable then the first message will not be logged to syslog after syslog is running again
> * two and more messages are attempted to be logged during syslog is unreachable then everything is logged correctly after syslog is running again
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 2 months
[JBoss JIRA] (WFCORE-1401) TCP Syslog handler cannot log some messages after reconnect
by James Perkins (JIRA)
[ https://issues.jboss.org/browse/WFCORE-1401?page=com.atlassian.jira.plugi... ]
James Perkins closed WFCORE-1401.
---------------------------------
Resolution: Rejected
This is the expected behavior. Here's what happens in the {{org.jboss.logmanager.handlers.SyslogHandler}}.
* First message when the server is down is sent and no error is raised by the {{java.net.Socket}} therefore the syslog handler thinks all is okay
* A second message is sent this time the {{java.net.Socket}} throws a {{java.net.SocketException: Broken pipe}}. The syslog handler reports this and the socket attempts to reconnect, but the message is not sent again.
* The third message succeeds because the connection has once again been resestablished
This works in your second scenario as well because the socket keeps attempting to connect. A successful connection is made by the time you send your third message. There is a possibility the message might not be sent until the fourth or fifth message even. It all depends on when the socket is reconnected.
That said there is a setting, {{blockOnReconnect}} which defaults to {{false}}, that will guarantee the third message is logged. The handler will block until a connection has been reestablished. I would however only suggest this be used wrapped in an {{async-handler}} as you could stall the entire server until the connection has been reestablished.
> TCP Syslog handler cannot log some messages after reconnect
> -----------------------------------------------------------
>
> Key: WFCORE-1401
> URL: https://issues.jboss.org/browse/WFCORE-1401
> Project: WildFly Core
> Issue Type: Bug
> Components: Logging
> Reporter: Ondrej Lukas
> Assignee: James Perkins
> Attachments: logging-deployment.war
>
>
> In case when logging to syslog through TCP protocol is configured and syslog port becomes unreachable then after syslog restart some messages can be thrown away.
> It seems syslog handler needs to another two logs for correct closing original TCP connection. In case when syslog is restarted and
> * no message is logged during syslog is unreachable then the first two messages will not be logged to syslog after syslog is running again
> * one message is attempted to be logged during syslog is unreachable then the first message will not be logged to syslog after syslog is running again
> * two and more messages are attempted to be logged during syslog is unreachable then everything is logged correctly after syslog is running again
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 2 months
[JBoss JIRA] (WFCORE-1369) Audit logging to TCP syslog is stopped after syslog restart
by James Perkins (JIRA)
[ https://issues.jboss.org/browse/WFCORE-1369?page=com.atlassian.jira.plugi... ]
James Perkins commented on WFCORE-1369:
---------------------------------------
Note the PR allows for a better reconnect, but the reconnect will not work as expected in the description of this issue. If a syslog server goes down or the connection is dropped it will take 2 messages sent before a third one will be logged. On the first message sent after a disruption will simply be ignored by the {{java.net.Socket}}. The second message sent will throw a {{java.net.SocketException: Broken pipe}}. This error is thrown by the syslog audit log handler and the connection state is reset indicating it should be reconnected. Finally the third message will go through.
> Audit logging to TCP syslog is stopped after syslog restart
> -----------------------------------------------------------
>
> Key: WFCORE-1369
> URL: https://issues.jboss.org/browse/WFCORE-1369
> Project: WildFly Core
> Issue Type: Bug
> Components: Domain Management
> Affects Versions: 2.0.10.Final
> Reporter: Ondrej Lukas
> Assignee: James Perkins
>
> In case when audit logging to TCP syslog is enabled and syslog server is restarted then audit logging to syslog is stopped. UDP works correctly. It can be related to issue [1].
> [1] https://issues.jboss.org/browse/LOGMGR-123
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
10 years, 2 months