shardingsphere-elasticjob icon indicating copy to clipboard operation
shardingsphere-elasticjob copied to clipboard

AbstractDistributeOnceElasticJobListener afterJobExecuted may execute before job finish execution on other instances

Open kaihekaihe opened this issue 3 years ago • 2 comments

Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot reproduce it on current information, we will close it.

Please answer these questions before submitting your issue. Thanks!

Which version of ElasticJob did you use?

3.0.0

Which project did you use? ElasticJob-Lite or ElasticJob-Cloud?

ElasticJob-Lite

Expected behavior

AbstractDistributeOnceElasticJobListener afterJobExecuted execute after job finish execution on all instances

Actual behavior

AbstractDistributeOnceElasticJobListener afterJobExecuted may execute before job finish execution on other instances

Reason analyze (If you can)

Any of the instances can register all shardingItems as completed Set<Integer> shardingItems = shardingContexts.getShardingItemParameters().keySet(); if (shardingItems.isEmpty()) { return; } guaranteeService.registerComplete(shardingItems);

Steps to reproduce the behavior.

Example codes for reproduce this issue (such as a github link).

kaihekaihe avatar Dec 31 '21 02:12 kaihekaihe

@kaihekaihe Thanks for you feedback! Do you have any idea about fixing this? Maybe only the leader can register complete?

TeslaCN avatar Dec 31 '21 09:12 TeslaCN

Each instance register its own shard complete?

kaihekaihe avatar Jan 04 '22 07:01 kaihekaihe

Hi @kaihekaihe I've tested the AbstractDistributeOnceElasticJobListener but I failed to reproduce this issue. shardingContexts .getShardingItemParameters() only returns items owned by the instance.

TeslaCN avatar Oct 13 '22 09:10 TeslaCN