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

MNTOR-4066: Turn cronjob into long-running interruptible task #5658

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Vinnl
Copy link
Collaborator

@Vinnl Vinnl commented Feb 24, 2025

References:

Jira: MNTOR-4066
Figma:

Description

This makes the breach-alerts cronjob explicitly interruptible via SIGINT, and adds a script to turn it into a long-running task, instead of a script meant for periodical execution. This should enable scaling it based on the size of the PubSub queue.

We should be able to merge this without any changes to our infra, and after merging allow us to make changes to our infra without breaking the script. (In other words, it allows for a backwards-compatible transition.)

How to test

Follow the instructions under PubSub in the readme, but replace dev:cron:breach-alerts by dev:task:breach-alerts. (Or alternatively, set LOOP="true" in your environment. We can remove that env var after we've transitioned.)

You can test out that it exits on SIGINT by finding the process ID, then running kill -SIGINT <process ID>.

Checklist (Definition of Done)

  • Localization strings (if needed) have been added.
  • Commits in this PR are minimal and have descriptive commit messages.
  • I've added or updated the relevant sections in readme and/or code comments - No, cause we haven't transitioned to this method yet.
  • I've added a unit test to test for potential regressions of this bug. - No, very side-effect heavy.
  • If this PR implements a feature flag or experimentation, I've checked that it still works with the flag both on, and with the flag off.
  • If this PR implements a feature flag or experimentation, the Ship Behind Feature Flag status in Jira has been set
  • Product Owner accepted the User Story (demo of functionality completed) or waived the privilege.
  • All acceptance criteria are met.
  • Jira ticket has been updated (if needed) to match changes made during the development process.
  • Jira ticket has been updated (if needed) with suggestions for QA when this PR is deployed to stage.

This makes the breach-alerts cronjob explicitly interruptible via
SIGINT, and adds a script to turn it into a long-running task,
instead of a script meant for periodical execution. This should
enable scaling it based on the size of the PubSub queue.
@Vinnl Vinnl added the Review: XS Code review time: up to 30min label Feb 24, 2025
@Vinnl Vinnl requested a review from rhelmer February 24, 2025 19:49
@Vinnl Vinnl self-assigned this Feb 24, 2025
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Review: XS Code review time: up to 30min
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants