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

Add association between Process and Jobs, and add a heartbeat to the Process record #999

Merged
merged 1 commit into from
May 21, 2024

Conversation

bensheldon
Copy link
Owner

@bensheldon bensheldon commented Jul 6, 2023

Connects to #831 / #985.

  • Adds locked_by_id and locked_at columns to Jobs which is updated when the job is executed with the GoodJob::Process.id and then unset after executing.
  • Creates a ProcessTracker which is responsible for creating and destroying GoodJob::Process records when locks are taken, and also refreshing the record in the background on a regular cadence (a heartbeart)

Goal here is to have all of the database migrations in place for the major GoodJob 4.0 release (#764) so that developers can safely opt into new behavior (like using row-level-locks+heartbeat instead of advisory locks)

@bensheldon bensheldon force-pushed the track_process branch 3 times, most recently from 5395310 to 8a8c639 Compare July 11, 2023 20:46
@bensheldon bensheldon force-pushed the track_process branch 9 times, most recently from e2b9d2d to f2914ab Compare July 24, 2023 16:29
@bensheldon bensheldon force-pushed the track_process branch 3 times, most recently from 5009e6b to 0dedace Compare July 28, 2023 23:33
@bensheldon bensheldon changed the title Add columns for future process-based locking strategy Ensure Process records always exist when executing jobs and are refreshed in background Aug 8, 2023
@bensheldon bensheldon changed the title Ensure Process records always exist when executing jobs and are refreshed in background Ensure Process records always exist when executing jobs and are heartbeat refreshed in background Aug 8, 2023
@bensheldon bensheldon force-pushed the track_process branch 5 times, most recently from dea2385 to ef6c79c Compare August 25, 2023 21:03
@bensheldon bensheldon force-pushed the track_process branch 7 times, most recently from 547700d to 9618162 Compare September 3, 2023 22:38
@bensheldon bensheldon changed the title Ensure Process records always exist when executing jobs and are heartbeat refreshed in background Add association between Process and Jobs, and add a heartbeat to the Process record May 21, 2024
@bensheldon bensheldon merged commit 54e41ca into main May 21, 2024
21 checks passed
@bensheldon bensheldon deleted the track_process branch May 21, 2024 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant