opencensus-java icon indicating copy to clipboard operation
opencensus-java copied to clipboard

Consider changing DisruptorEventQueue.enqueue() to avoid possibility of blocking

Open jmullins opened this issue 5 years ago • 1 comments

Does it make sense to change DisruptorEventQueue.enqueue() to use RingBuffer.tryNext() instead of RingBuffer.next() to avoid possibly blocking in the case the producers overrun the consumer due to load or a future bug in the consumer?

In all of our use-cases our preference would be to drop the metrics rather than block.

https://github.com/census-instrumentation/opencensus-java/blob/aa8ee6a526e11e5763d2f508bd6952a1b87e3a51/impl/src/main/java/io/opencensus/impl/internal/DisruptorEventQueue.java#L130-L142

jmullins avatar Mar 22 '19 15:03 jmullins

I created PR for this issue! : https://github.com/census-instrumentation/opencensus-java/pull/1837

saiya avatar Apr 09 '19 03:04 saiya