Fix log manager hanging on waiting for pending file rotations.

This changes writer implementations to always respond to rotation
messages in their DoRotate() method, even for failure/no-op cases
with a new RotationFailedMessage.  This informs the manager to
decrement its count of pending rotations.

Addresses #860.
This commit is contained in:
Jon Siwek 2012-07-27 13:31:17 -05:00 committed by Robin Sommer
parent 4bdac985cb
commit 4359bf6b42
8 changed files with 79 additions and 1 deletions

View file

@ -153,6 +153,7 @@ public:
protected:
friend class WriterFrontend;
friend class RotationFinishedMessage;
friend class RotationFailedMessage;
friend class ::RemoteSerializer;
friend class ::RotationTimer;
@ -178,6 +179,12 @@ protected:
bool FinishedRotation(WriterFrontend* writer, const char* new_name, const char* old_name,
double open, double close, bool terminating);
// Signals that a file couldn't be rotated, either because the writer
// implementation decided there was nothing to do or because a real error
// occurred. In the error case, a separate message for the reason is sent.
bool FailedRotation(WriterFrontend* writer, const char* filename,
double open, double close, bool terminating);
// Deletes the values as passed into Write().
void DeleteVals(int num_fields, threading::Value** vals);