alibaba / jstorm

Enterprise Stream Process Engine
http://jstorm.io
Apache License 2.0
3.91k stars 1.81k forks source link

2.4源码下事务的例子死循环 #571

Open lcy362 opened 7 years ago

lcy362 commented 7 years ago

TransactionTestTopology运行的时候

builder.setSpout("spout", new ScheduleTxSpout(), spoutParallelism); 这句会stackoverflow.

原因是TransactionTopologyBuilder里两个方法

public SpoutDeclarer setSpout(String id, ITransactionSpoutExecutor spout, Number parallelismHint, boolean isSchedule) {
        return setSpout(id, spout, parallelismHint, isSchedule);
    }

    private SpoutDeclarer setSpout(String id, IRichSpout spout, Number parallelismHint, boolean isSchedule) {
        upToDownstreamComponentsMap.put(id, new HashSet<String>());
        IRichSpout spoutExecutor;

本意应该是build topology的时候调第一个,然后第一个再调第二个,但是实际上会一直调第一个。

这块是代码没提交全,还是使用方法不对,还是哪的问题?