-
Notifications
You must be signed in to change notification settings - Fork 37
Avoid write on closed output writer #94
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 #94
Conversation
Add Spring javadocs URL in pom.xml's maven-javadoc-plugin configuration
* implement ignore-configuration-noy-found * add <jmxtrans:configuration /> sub elements
Enhance <jmxtrans:jmxtrans /> spring namespace
* implement ignore-configuration-noy-found * add <jmxtrans:configuration /> sub elements
Fix Spring ObjectFactory implementation
…d instead of outputting millis for the timestamp.
Use Graphite's output format as in jmxtrans for Console and SLF4J writers
Add Getting Started Guide
Fix version in docs
enhance docs
Migrate from BuildHive to CloudBees FOSS Program
…ol and GlobalRequestProcessor. http-nio and ajp-nio Thread Pools and GlobalRequestProcessor MBean's names are always suffixed with the port number (for instance http-nio-8080). When the port number is randomly assigned (running in a PaaS like CloudFoundry), metrics will have different names every times tomcat is (re)started. This can be an issue in case you have a metric quota on the backend (when using hosted service like hostedgraphite.com). Even in the absence of a quota, it will simply fillup the backend disk partition really quickly. Also the metrics will be shortlive, and won't be easy to aggregate in the long run. In order to fix that, we match each individual ObjectName with its prefix (commonly "http-nio-" and "ajp-nio-" in Tomcat) followed with a wildcard for the port number we don't know in advance. The resultAlias will not contain the port number at all, but transform to "http-nio" and "ajp-nio" respectively. Note that when using a wildcard in a litteral attribute matcher, the value should be enclosed in double-quotes.
…a "tlsInsecure" flag to support invalid x509 certificates (server Root CA not trusted by the client, expired cert ...)
…etricNames Predictable Tomcat NIO Metric Names
…re (self signed certificates...)
… been tested with hosted graphite.com)
…hite-writer [GraphiteWriter] Add support for TLS/SSL for TCP connections
… introduced unit tests proving issue jmxtrans#105
Using clear() reset the limit to the ByteBuffer capacity. The rewind() is unnecessary after the flip(): position is already set to zero.
…gement Improve ByteBuffer management
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must say I prefer the previous implementation here, better to give running tasks a chance to finish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to await for the tasks termination, as one last collect and export will be executed anyways. If a collect and/or export is interrupted, not data will be lost, because we will collect again then export again.
awaitTermination is only making the application (and the JVM) longer to stop.
….felix:maven-bundle-plugin, in order to allow the project to build with Java 6
explicitly set the version for plugin maven-bundle-plugin, in order to allow the project to build with Java 6
This reverts commit 4f1ce2c.
|
Just updated the PR branch with the changes from master |
696645d to
760eba8
Compare
When an application is stopped, the ApplicationContext stops all of the OutputWriters.
Export tasks that were already scheduled or running then was trying to export to OutputWriters that were closed.
This could produce some errors (alarming Exceptions in the logs), depending on the implementation of the OutputWriters. For instance, the GraphiteWriter closes it's internal connection pool when stopped, so that it cannot be used after that. Some others OutputWriters are fine with that because there stop method does nothing. (ConsoleWriter or GraphiteHttpWriter for instance)
This PR introduces a state management class that ensures that a stopped OutputWriter is never written.
Concurrent writes (to same OutputWriter by multiple Threads) are still supported.