shardingsphere-elasticjob
shardingsphere-elasticjob copied to clipboard
AbstractDistributeOnceElasticJobListener afterJobExecuted may execute before job finish execution on other instances
Bug Report
For English only, other languages will not accept.
Before report a bug, make sure you have:
- Searched open and closed GitHub issues.
- Read documentation: ElasticJob Doc.
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 Thanks for you feedback! Do you have any idea about fixing this? Maybe only the leader can register complete?
Each instance register its own shard complete?
Hi @kaihekaihe
I've tested the AbstractDistributeOnceElasticJobListener
but I failed to reproduce this issue. shardingContexts .getShardingItemParameters()
only returns items owned by the instance.