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

Avoid write on closed output writer #112

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

YannRobert
Copy link
Contributor

This reopen PR #94

In some case, we can get ```java.lang.IllegalStateException: Pool not open``` when Thread ```jmxtrans-export-1``` calls write(...) on a GraphiteWriter that was previously closed.
In order to prevent that - as much as possible - we can shutdownNow() the ScheduledExecutorServices so that tasks that are currently running can detect that the Thread is interrupted, and eventually terminate earlier.
… state of each of the OutputWriters is maintained by OutputWriterSet class, that also provided way to ensure consistent write on all OutputWriters even when some of them are failing. Methods ```startAll()```, ```stopAll()``` and ```writeAll()``` are mutually synchronized, so that we neither stop OutputWriters while writing on it, nor write with OutputWriter while or after they are stopped.
…to allow concurrent calls to writeAll() but still control that writeAll() cannot be used while the Object is changing it's internal state (starting or stopping)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant