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

Warn when a job should start but is still running #26

Merged
merged 1 commit into from
Jan 11, 2018

Conversation

krallin
Copy link
Collaborator

@krallin krallin commented Jan 10, 2018

This will make it easier for users to debug hung jobs: rather than
requiring users to go back to when the job started to realize
(implicitly) that it's not running, this will warn at every interval
that something is wrong.


cc @fancyremarker @UserNotFound

This will make it easier for users to debug hung jobs: rather than
requiring users to go back to when the job started to realize
(implicitly) that it's not running, this will warn at every interval
that something is wrong.
@krallin krallin force-pushed the warn-on-still-running branch from 49e0a3c to 9a964c8 Compare January 10, 2018 12:49
@krallin
Copy link
Collaborator Author

krallin commented Jan 10, 2018

This produces output like this:

INFO[2018-01-10T13:49:13+01:00] starting                                      iteration=0 job.command="sleep 2.5" job.position=0 job.schedule="* * * * * * *"
WARN[2018-01-10T13:49:14+01:00] not starting: job is still running since 2018-01-10 13:49:13 +0100 CET (1s elapsed)  iteration=0 job.command="sleep 2.5" job.position=0 job.schedule="* * * * * * *"
WARN[2018-01-10T13:49:15+01:00] not starting: job is still running since 2018-01-10 13:49:13 +0100 CET (2s elapsed)  iteration=0 job.command="sleep 2.5" job.position=0 job.schedule="* * * * * * *"
INFO[2018-01-10T13:49:15+01:00] job succeeded                                 iteration=0 job.command="sleep 2.5" job.position=0 job.schedule="* * * * * * *"
WARN[2018-01-10T13:49:15+01:00] job took too long to run: it should have started 1.503185062s ago  job.command="sleep 2.5" job.position=0 job.schedule="* * * * * * *"

See it action with: make build && ./supercronic integration/timeout.crontab.

Copy link
Member

@fancyremarker fancyremarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@krallin krallin merged commit dc4b31f into aptible:master Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants