seata1.5.2|1.6 saga模式存在 java.lang.NullPointerException: null at java.base/java.util.Date.getMillisOf(Date.java:956) bug

lzfw57am  于 22天前  发布在  Java
关注(0)|答案(4)|浏览(25)

问题描述:saga模式时,客户端调用两个服务,这两个服务都有补偿服务,例如:
A服务 -- 补偿服务为 AU
B服务 -- 补偿服务为 BU
seata服务为远程服务模式。
当客户端运行时,根据流程定义先执行A服务,再执行B服务,此时B服务出现异常,根据流程定义如果抛出异常则触发补偿机制,即开始执行BU服务,然后再执行AU服务。这个是正常流程。
如果在执行BU服务还有没有结束时,强制停止运行(模拟挂机),此时BU这个补偿服务在seata_state_inst表里的记录的gmt_end为null,下次再重新运行客户端时,seata服务会远程触发二阶段回滚,二阶段回滚成功后,我再调用如下代码:

String instancdID = stateMachineEngine.getStateMachineConfig().getStateLogStore().
                     getStateMachineInstanceByBusinessKey(businessKey, null).getId();

会导致如下异常:

分析原因知道是由于代码里没有判断gmt_end=null的情况,下方代码出错位置如下:

l0oc07j2

l0oc07j22#

@ulwx This problem was fixed in version 1.6.0, please help to confirm whether this problem exists in 1.6.

dxxyhpgq

dxxyhpgq3#

1.6.1同样存在这个问题,没有修复干净
@ulwx This problem was fixed in version 1.6.0, please help to confirm whether this problem exists in 1.6.

nwlls2ji

nwlls2ji4#

1.6.1同样存在这个问题,没有修复干净
@ulwx This problem was fixed in version 1.6.0, please help to confirm whether this problem exists in 1.6.

辛苦提供一下错误栈? 还是同样的代码栈吗?
Could you please provide the error stack? Is it the same code stack?

相关问题