Stuck data in disruptor

180 views
Skip to first unread message

dan.m...@gmail.com

unread,
Sep 12, 2017, 1:10:22 AM9/12/17
to mechanical-sympathy
hi, we face some issue which happens approximately after one day after running our application on Ubuntu linux. We use a disruptor and after one-day messages are published into disruptor but no invocation of event handler happens. 

Our disruptor config
 disruptor = new Disruptor<>(new OrderEventFactory(),
                                    BUFFER_SIZE,
                                    Executors.defaultThreadFactory(),
                                    ProducerType.SINGLE,
                                    new YieldingWaitStrategy());
        RingBuffer<OurEvent > ringBuffer = disruptor.getRingBuffer();
        producer = new OurEventProducer(ringBuffer);
        disruptor.handleEventsWith(new OurEventHandler()).then((event, sequence, endOfBatch) -> {
            event.clear();
        });
        disruptor.start();



public class OurEventProducer{

    private final RingBuffer<OurEvent > ringBuffer;

    public OrderEventProducer(RingBuffer<OurEvent > ringBuffer)
    {
        this.ringBuffer = ringBuffer;
    }

    public void onData(OurEvent wrapper)
    {
        long sequence = ringBuffer.next(); 
        try
        {
            EventWrapper eventWrapper = ringBuffer.get(sequence); 
            eventWrapper.setRequest(wrapper.getRequest());
        }
        catch(Exception e) {
            LOGGER.error("Error publishing event with " + sequence, e);
        }
        finally
        {
            ringBuffer.publish(sequence);
            LOGGER.info("Published event with sequence " + sequence);
        }
    }
}


Now our OurEventHandler has this log msg and logic after that, also it suppresses all exceptions

    @Override
    public void onEvent(OurEvent event, long sequence, boolean endOfBatch) throws Exception {
   try {
LOGGER.info("Incoming event " + event.getRequest());
} catch(Exception e) {
}
}


After a day of load we see a lot of msgs "Published event with sequence" but no "Incoming event" messages from handler, i.e. we see that messages are published, but not consumed. What is the possible reason for that? Can it be that disruptor is full? If yes, why in this case it allows publishing of data?


Our disruptor buffer size is 1024 and we use Disruptor version 3.3.6.


Thanks.



dan.m...@gmail.com

unread,
Sep 12, 2017, 1:12:06 AM9/12/17
to mechanical-sympathy
apologiez, please, remove this post, I forgot that it should be asked on Disruptor forum
Reply all
Reply to author
Forward
0 new messages