Skip to content

Misfire funcationality question #2490

@txm119161336

Description

@txm119161336

As i see , currently if we have one job that is misfired ,the quartz framework will trigger the job after the current job is finised , meanwhile you have trigger listener to setup misfired info to zookeeper ,which means the misfired job may execute twice,one of which is quartz framework trigger,the other one of which is you have missfire loop after job execution logic. So that is to say ,the job will misfire twice,is that a problem?

executionService.cleanPreviousExecutionInfo(); //清理上次分片的标记信息
executeJobInternal(shardingContext); // first execution
log.debug("Elastic job: execute normal completed, sharding context:{}.", shardingContext);

    while (configService.isMisfire() && !executionService.getMisfiredJobItems(shardingContext.getShardingItems()).isEmpty() && !stoped && !shardingService.isNeedSharding()) {
        log.debug("Elastic job: execute misfired job, sharding context:{}.", shardingContext);
        //将 execution/{item}/misfire节点删除
        executionService.clearMisfire(shardingContext.getShardingItems());
        executeJobInternal(shardingContext); //second execution
        log.debug("Elastic job: misfired job completed, sharding context:{}.", shardingContext);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions