Flush logs and don't spin at 100% CPU #2

Merged
merged 2 commits into from May 6, 2011

Conversation

Projects
None yet
2 participants
Contributor

chiselwright commented May 6, 2011

Hi,

I've had a few problems with log messages 'disappearing' - it looks like there's a condition where you can't connect to the server, die, log() the error after the eval{} ... but never _flush() the log handle.

As long as you keep not connecting, you keep logging but not flushing.

The first commit explicitly flushes in the error-and-log block - so that people can see something has gone wrong.

The second commit just stops the while loop going a bit crazy trying to continuously reconnect in the while(1){...} loop, needlessly pushing the CPU usage to 100%.

Hopefully these aren't insane and can be rolled into 0.16.

chiselwright added some commits May 6, 2011

Flush logs when there's an error
Sometimes we die in the eval{} *before* the call to _flush(); if this is a
connection error we never get to a point where the log information is flushed
somewhere visible

pmooney added a commit that referenced this pull request May 6, 2011

Merge pull request #2 from chiselwright/master
Flush logs and don't spin at 100% CPU

@pmooney pmooney merged commit 623958b into pmooney:master May 6, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment