getsentry / getsentry/sentry

Crons: Disallow missed margin larger than the smallest schedule gap

Open
#54,639 1 comment 0 reactions 1 assignee Claimed by @evanpurkhiser View on GitHub
Improvement Product Area: Crons
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
1d 5h
Merged PRs (30d)
624

Description

Take a monitor that is run once an hour as an example

![image](https://github.com/getsentry/sentry/assets/1421724/da7121aa-ded8-49d4-ad35-bb9b21d20b01)

Imagine now that I've configured the monitor to have a 'missed margin' of 2 hours. This would look like this:

![image](https://github.com/getsentry/sentry/assets/1421724/a5e7ad1d-e1c7-4eb3-89d5-a2880e6faa35)

Importantly note that the margins are overlapping each other

So now imagine that the first checkin does not happen on time. The red line indicates the current time. We have not checked in, but we have also not marked anything as missing due to the 2 hour check-in margin.

![image](https://github.com/getsentry/sentry/assets/1421724/9d2b2cc6-364c-4f67-a75a-85f057e1a306)

What should happen now if a check-in occurs? does it complete the checkin at 12:00?

If yes, then what happens when the next check-in occurs? It may have been that the users cron scheduler was off for the period of 12:00 → 1:00, and it may be configured such that that task was just skipped, and the checkin we got a little after 1:00 was intended to be for 1:00. Now if we continue with our logic that the next checkin that happens at 2:00 should actually be for 1:00 **that would be incorrect**.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.