Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Job sometimes reports as "already running" when it isn't, and then runs anyway #241

Open
3 tasks done
neilenns opened this issue Jan 26, 2024 · 0 comments
Open
3 tasks done
Labels
bug Something isn't working

Comments

@neilenns
Copy link

neilenns commented Jan 26, 2024

Describe the bug

Node.js version: 20.11.x

OS version: Alpine 3.18

Description:

I have a job that is scheduled to run "every 1 minute" and takes about 5 seconds to complete. Every so often Bree will think the job is already running when it isn't, then will then happily start it running anyway. Here's an example from my logs:

2024-01-26T02:10:12.437Z [jobs] Worker deleted: getVatsimData
2024-01-26T02:10:12.438Z [jobs] Current jobs: getVatsimEndpoints, importAirports, getVatsimData, getVatsimTransceivers
2024-01-26T02:10:12.439Z [jobs] Current workers: 
2024-01-26T02:10:59.996Z [jobs] Worker created: getVatsimData
2024-01-26T02:10:59.997Z [jobs] Current jobs: getVatsimEndpoints, importAirports, getVatsimData, getVatsimTransceivers
2024-01-26T02:10:59.997Z [jobs] Current workers: getVatsimData
2024-01-26T02:11:00.001Z [jobs] Error: Job "getVatsimData" is already running
2024-01-26T02:11:00.063Z [jobs] Worker for job "getVatsimData" online

I'm using the worker created and worker deleted events to write out the current jobs and current workers when jobs are created and deleted. In the logs above getVatsimData finished running at 2:10:12 and there were no active workers when it exited. The next run of the job started at 2:10:59 and resulted in the "already running" error, but then started anyway just 62ms later.

Expected behavior

No warning.

Code to reproduce

No standalone code, but my bree code is in a single file in my repo.

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
@neilenns neilenns added the bug Something isn't working label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant