Ensure at least 1 thread for thread pool.

This commit is contained in:
Chuanyi Li L
2018-08-23 17:51:25 +08:00
parent e879216fa4
commit 1aa2e1a409

View File

@@ -80,8 +80,8 @@ public class MysqlMultiStageCoprocessor extends AbstractCanalLifeCycle implement
this.disruptorMsgBuffer = RingBuffer.createSingleProducer(new MessageEventFactory(),
ringBufferSize,
new BlockingWaitStrategy());
this.parserExecutor = Executors.newFixedThreadPool(parserThreadCount,
int tc = parserThreadCount > 0 ? parserThreadCount : 1;
this.parserExecutor = Executors.newFixedThreadPool(tc,
new NamedThreadFactory("MultiStageCoprocessor-Parser-" + destination));
this.stageExecutor = Executors.newFixedThreadPool(2, new NamedThreadFactory("MultiStageCoprocessor-other-"