metrics icon indicating copy to clipboard operation
metrics copied to clipboard

GraphiteReporter + PickledGraphite - IllegalStateException "Already connected"

Open steve-oakey opened this issue 9 years ago • 5 comments

Using version 3.2.2, I am getting these exceptions about every 5 minutes. My reporting rate is every minute, so I receive this error regularly every 5th minute. Any ideas what may be happening? I don't see any errors indicating that the call to graphite.close() failed in the GraphiteReporter or that closing the PickledGraphite writer and socket failed.

steve-oakey avatar Apr 06 '17 13:04 steve-oakey

@steve-oakey a stack trace would help...

osigida avatar Apr 06 '17 15:04 osigida

I'm on an air-gapped network so here is a paraphrased stack trace. Not sure how much help this will be.

java.lang.IllegalStateException: Already connected
  at PickledGraphite.connect(PickledGraphite:173)
  at GraphiteReporter.report(GraphiteReporter:240)
  at ScheduledReporter.report(ScheduledReporter:251)
  at ScheduledReporter$1.run(ScheduledReporter:174)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors:511)
  at java.util.concurrent ....
  at java.util.concurrent ....

I'm using the default Executor so it is a single thread scheduled executor.

steve-oakey avatar Apr 06 '17 17:04 steve-oakey

That's very strange. My first guess is that calls to GraphiteReporter#report intersect in some way and cause one of them to fail. It would be really great to have a reproducer, but other debug information would be helpful too.

arteam avatar Apr 07 '17 21:04 arteam

Hi,

@arteam I recently migrated also to 3.2.2 and having similar issue:

23:03:05.438 ERROR c.codahale.metrics.ScheduledReporter  - Exception thrown from GraphiteReporter#report. Exception was suppressed.
java.lang.IllegalStateException: Already connected
	at com.codahale.metrics.graphite.Graphite.connect(Graphite.java:111)
	at com.codahale.metrics.graphite.GraphiteReporter.report(GraphiteReporter.java:240)
	at com.codahale.metrics.ScheduledReporter.report(ScheduledReporter.java:251)
	at com.codahale.metrics.ScheduledReporter$1.run(ScheduledReporter.java:174)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

could it related somehow to that: https://github.com/dropwizard/metrics/issues/1100 ?

mazorigal avatar Jul 14 '17 21:07 mazorigal

This issue is stale because it has been open 180 days with no activity. Remove the "stale" label or comment or this will be closed in 14 days.

github-actions[bot] avatar Sep 04 '19 00:09 github-actions[bot]