Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

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

Open
jmullins opened this issue Mar 22, 2019 · 1 comment

Comments

@jmullins
Copy link

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.

DisruptorEnqueuer enqueuer =
new DisruptorEnqueuer() {
@Override
public void enqueue(Entry entry) {
long sequence = ringBuffer.next();
try {
DisruptorEvent event = ringBuffer.get(sequence);
event.setEntry(entry);
} finally {
ringBuffer.publish(sequence);
}
}
};

@saiya
Copy link

saiya commented Apr 9, 2019

I created PR for this issue! : #1837

@songy23 songy23 added the P1 label Apr 26, 2019
saiya added a commit to saiya/opencensus-java that referenced this issue May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants