[Fix](Job)Concurrency may result in event loss (#29385)
This commit is contained in:
@ -50,7 +50,7 @@ public class TaskDisruptor<T> {
|
||||
WaitStrategy waitStrategy, WorkHandler<T>[] workHandlers,
|
||||
EventTranslatorVararg<T> eventTranslator) {
|
||||
disruptor = new Disruptor<>(eventFactory, ringBufferSize, threadFactory,
|
||||
ProducerType.SINGLE, waitStrategy);
|
||||
ProducerType.MULTI, waitStrategy);
|
||||
disruptor.handleEventsWithWorkerPool(workHandlers);
|
||||
this.eventTranslator = eventTranslator;
|
||||
disruptor.start();
|
||||
|
||||
@ -81,7 +81,7 @@ public class TaskDisruptor implements Closeable {
|
||||
public void start() {
|
||||
ThreadFactory producerThreadFactory = DaemonThreadFactory.INSTANCE;
|
||||
disruptor = new Disruptor<>(TaskEvent.FACTORY, DEFAULT_RING_BUFFER_SIZE, producerThreadFactory,
|
||||
ProducerType.SINGLE, new BlockingWaitStrategy());
|
||||
ProducerType.MULTI, new BlockingWaitStrategy());
|
||||
WorkHandler<TaskEvent>[] workers = new TaskHandler[consumerThreadCount];
|
||||
for (int i = 0; i < consumerThreadCount; i++) {
|
||||
workers[i] = new TaskHandler(transientTaskManager);
|
||||
|
||||
Reference in New Issue
Block a user