Red Hat Bugzilla – Bug 535575
log4j error thrown when running 'quit' on agent in Solaris
Last modified: 2014-05-02 13:51:46 EDT
When shutting down agent in Solaris, log4j error is thrown. This seems like a regression, I don't remember seeing this in earlier releases.
1. Install agent
2. Let agent run long enough to get the ">" prompt
4. View results
Expected results: Clean shutdown
RHQ 1.3.0-SNAPSHOT  (Tue Jul 21 08:59:45 PDT 2009)
Agent no longer accepting input at prompt.
log4j:ERROR Failed to flush writer,
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(Unknown Source)
at sun.nio.cs.StreamEncoder.writeBytes(Unknown Source)
at sun.nio.cs.StreamEncoder.implFlushBuffer(Unknown Source)
at sun.nio.cs.StreamEncoder.implFlush(Unknown Source)
at sun.nio.cs.StreamEncoder.flush(Unknown Source)
at java.io.OutputStreamWriter.flush(Unknown Source)
The agent will wait for  threads to die
Shutdown complete - agent will now exit.
[12:47] <mazz> this doesn't look bad. you are in the middle of shutting down - when the agent is shutting down, it
sends interrupts to all its threads (including this primary switchover thread) so those threads
know, "we are shutting down, everyone stop what you are doing and exit"
[12:48] <mazz> this is just that you happened to interrupt right before or during the time a log message was
getting written out
[12:48] <cswiii> seems to happen every single time i 'quit'
[12:49] <cswiii> would i be interrupting logwriting every time?
[12:49] <cswiii> maybe i'll let this run for a while and see
[12:49] <mazz> might be due to the way solaris and the native NIO is implemented
[12:49] <mazz> and how it works with the way log4j is using it
[12:50] <mazz> but for sure the shutdown is cause - we are really interruptting it
this is a stack thrown from log4j when agent is shutting down. Its a minor issue since nothing bad is really happening, its just a log message at shutdown due to the shutdown interrupts
well, not just a log message, if running in foreground, its a stdout message
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-2256
Temporarily adding the keyword "SubBug" so we can be sure we have accounted for all the bugs.
new = Tracking + FutureFeature + SubBug
making sure we're not missing any bugs in rhq_triage
interesting race condition. agreed, that's it's low priority due to the timing and the fact that the agent is already being shut down. however, it could be alarming to users. it should be fixed.