Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bull
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 175
    • Issues 175
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OptimalBits
  • bull
  • Issues
  • #871
Closed
Open
Issue created Feb 20, 2018 by Administrator@rootContributor

Stuck non-repeating repeatable job

Created by: alexkh13

Description

The repeatable job appears to exists in the "repeat" zset but an actual job doesn't exist. The result is that getRepeatableJobs() notifies about a job that isn't happening and is never going to happen. The only option is to remove it and re-add it again.

Test code to reproduce

Couldn't reproduce it. By looking at the code, it seems like an extreme edge case. The only way I see this could happen is if the process was shutdown aggressively right after the zadd finished and couldn't get to the Job.create() in time.

return client
        .zadd(_this.keys.repeat, nextMillis, repeatJobKey)
        .then(function() {
          //
          // Generate unique job id for this iteration.
          //
          var customId = getRepeatJobId(
            name,
            jobId,
            nextMillis,
            md5(repeatJobKey)
          );
          now = Date.now();
          var delay = nextMillis - now;

          return Job.create(
            _this,
            name,
            data,
            _.extend(_.clone(opts), {
              jobId: customId,
              delay: delay < 0 ? 0 : delay,
              timestamp: now,
              prevMillis: nextMillis
            })
          );
        });

Bull version

3.3.10

Assignee
Assign to
Time tracking