Disable flush when writer has been shutdown
@@ -151,6 +151,7 @@ public class DDAgentWriter implements Writer {
/** This method will block until the flush is complete. */
public void flush() {
+ if (running) {
log.info("Flushing any remaining traces.");
// Register with the phaser so we can block until the flush completion.
apiPhaser.register();
@@ -162,6 +163,7 @@ public class DDAgentWriter implements Writer {
log.warn("Waiting for flush interrupted.", e);
}
}
+ }
@Override
public String toString() {
