Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race in [3rd-party] rotor-appender #168

Closed
mikesperber opened this issue May 10, 2016 · 4 comments
Closed

Race in [3rd-party] rotor-appender #168

mikesperber opened this issue May 10, 2016 · 4 comments

Comments

@mikesperber
Copy link
Contributor

We're seeing truncation of log files with rotor-appender.
It seems there's an obvious race when logging is done from multiple threads:
If multiple invocations of rotate-logs run concurrently (actually quite probable), then one might delete the logs the other just shifted into the position of the oldest log.
I suggest setting async? to true.

@ptaoussanis
Copy link
Member

Hi Mike, thanks for the report.

I'm not involved with any of the 3rd-party appenders and have my hands pretty full atm but would be happy to see a PR that protects against the race condition. (E.g. a simple atom to help lock rotation).

Cheers! :-)

@ptaoussanis ptaoussanis changed the title Race in rotor-appender Race in [3rd-party] rotor-appender May 10, 2016
@ptaoussanis
Copy link
Member

Decided to just handle this myself quickly, thanks again for the report - cheers!

mikesperber added a commit to active-group/timbre that referenced this issue May 10, 2016
@mikesperber
Copy link
Contributor Author

Ups, sorry, didn't see this until now. Might still find the test useful.

@ptaoussanis
Copy link
Member

No problem, appreciate the PR - thanks!

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

No branches or pull requests

2 participants