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
  • #2286
Closed
Open
Issue created Feb 10, 2022 by Carlos Ferreira@carlos870

Lost keys when using job.progress(...)

Description

The job.progress method is not checking if the job key actually exists before updating the job's progress, which means we could end up with with an empty key left in Redis, only with the updated progress. If the job config uses a custom jobId (based on business logic - userId), this could become problematic, since no jobs for that user would be added anymore.

A simple solution that I tried and it seems to fix the issue, was to wrap the LUA script updateProgress (HSET/PUBLISH) inside a Redis EXISTS command.

This occurred in a scenario where we get the job (getJob()), and then try to update it's progress, and sometimes the job was already removed. We are using setting removeOnComplete.

Bull version

4.4.0

Assignee
Assign to
Time tracking