Details
-
Bug
-
Resolution: Fixed
-
Major
-
1.0.13
-
None
-
Linux mobile-pc 3.10.17 #2 SMP Wed Oct 23 16:34:38 CDT 2013 x86_64 Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz GenuineIntel GNU/Linux
java version "1.7.0_45"
Description
On my machine I noticed that when sending multiple logging events to a SocketAppender, only the first event gets serialized and sent over the wire to a ServerSocketReceiver.
Debuging the code, I found out that for sending loggingEvents the SocketAppender uses either a SynchronousQueue or an ArrayBlockingQueue in order to make producer-consumer and send serialized events to the socket. That BlockingQueue does behave erratically on my machine.
To demonstrate that I included a small java test that will send 3 events to a SynchronousQueue and to an ArrayBlockingQueue and the output is this:
### start test SynchronousQueue### + appender thread started - send 3 events - no more events to be sent + received event 1 + appender thread ended ### end test ### ### start test ArrayBlockingQueue[2]### + appender thread started - send 3 events - no more events to be sent ### end test ### ### start test ArrayBlockingQueue[3]### + appender thread started - send 3 events - no more events to be sent + received event 1 + received event 2 + received event 3 + appender thread ended ### end test ###
This shows that the SynchronousQueue only process the first event and ArrayBlockingQueue[2] does not work at all.
Another test iteration:
### start test SynchronousQueue### + appender thread started - send 3 events - no more events to be sent + received event 1 + appender thread ended ### end test ### ### start test ArrayBlockingQueue[2]### + appender thread started - send 3 events - no more events to be sent + received event 1 + received event 2 + appender thread ended ### end test ### ### start test ArrayBlockingQueue[3]### + appender thread started - send 3 events - no more events to be sent + received event 1 + received event 2 + received event 3 + appender thread ended ### end test ###
This time the SynchronousQueue only processes the first event and the ArrayBlockingQueue[2] processes the first 2 events.
Attachments
Issue Links
- is duplicated by
-
LOGBACK-911 SocketAppender maysilently drop events in quick succession
- Closed