-
Notifications
You must be signed in to change notification settings - Fork 14
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
#3667 - Bull Scheduler - Ensure Delayed Job #3995
Merged
andrewsignori-aot
merged 4 commits into
release/v2.1.0
from
feature/#3667-bull-scheduler-delayed-job
Nov 25, 2024
Merged
#3667 - Bull Scheduler - Ensure Delayed Job #3995
andrewsignori-aot
merged 4 commits into
release/v2.1.0
from
feature/#3667-bull-scheduler-delayed-job
Nov 25, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…y promoted (Ensure Next Delayed Job) (#3978) - Ensures a scheduled job will have a delayed job created with the next expected scheduled time based on the configured cron expression. - DB row used as a lock to ensure the initialization code will not recreate delayed jobs or create them in an unwanted way if two PODs start at the same time. To be clear, the lock approach is the same used in other areas of the application and locks a single row in the table queue-consumers, please not, the table will not be locked. Please see below the sample query executed. ```sql START TRANSACTION select "QueueConfiguration"."id" AS "QueueConfiguration_id" from "sims"."queue_configurations" "QueueConfiguration" where (("QueueConfiguration"."queue_name" = 'archive-applications')) LIMIT 1 FOR UPDATE COMMIT ``` - While the queue is paused, no other delayed jobs will be created.
To proceed with the investigation about the intermittent ioredis issue on DEV, the package was updated and more logs were added to try to narrow down the root cause of the issue.
During the prior investigation was detected that when all the schedulers try to execute redis operations at the same time it fails after a certain amount of concurrent connections. The possible solutions being investigated are: 1. Allow the connection sharing as mentioned here https://github.com/OptimalBits/bull/blob/develop/PATTERNS.md#reusing-redis-connections 2. Control the service initialization to prevent multiple concurrent connections. This is PR an attempt to test the first options.
Implementing the easy/fast (and stable) approach to resolve the queue initialization issues. During the previous approach, sharing the ioredis connections (change being reverted in this PR) worked but there was also a possible false-positive memory leak warning. Further investigation will be needed if we change this approach in the feature but for now, keeping the existing approach. The current solution extends the current "specific queue-based" lock to an "all queues-based" lock. The initialization is still pretty fast (around 1 second) and even if we double the number of schedulers in the future it still will be good enough (the code is executed once during queue-consumers initialization). _Notes_: The logs before mentioned the queue-name every time and now it has changed to only the first one. The queue-name should be in the log context also but many schedulers are not "overriding" it, which should be resolved in the schedulers.
|
guru-aot
approved these changes
Nov 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
dheepak-aot
approved these changes
Nov 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This was referenced Dec 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Moving the latest changes from Bull Scheduler to release 2.1.