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

#3667 - Bull Scheduler - Added Global Bootstrap Synchronization #3993

Merged

Conversation

andrewsignori-aot
Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot commented Nov 25, 2024

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These are the reverted changes from the previous PR putting back the code to its previous state.

Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 22.03% ( 3718 / 16876 )
Methods: 10.17% ( 214 / 2105 )
Lines: 25.36% ( 3226 / 12720 )
Branches: 13.55% ( 278 / 2051 )

Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 65.43% ( 583 / 891 )
Methods: 59.26% ( 64 / 108 )
Lines: 68.54% ( 464 / 677 )
Branches: 51.89% ( 55 / 106 )

Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 84.39% ( 1238 / 1467 )
Methods: 84.51% ( 120 / 142 )
Lines: 85.61% ( 1053 / 1230 )
Branches: 68.42% ( 65 / 95 )

@andrewsignori-aot andrewsignori-aot marked this pull request as ready for review November 25, 2024 17:05
Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 66.94% ( 5774 / 8625 )
Methods: 64.8% ( 718 / 1108 )
Lines: 70.87% ( 4531 / 6393 )
Branches: 46.71% ( 525 / 1124 )

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

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

Thanks again for the investigations and the solution looks good to me. .👍

Copy link
Collaborator

@guru-aot guru-aot left a comment

Choose a reason for hiding this comment

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

LGTM

@andrewsignori-aot andrewsignori-aot added this pull request to the merge queue Nov 25, 2024
Merged via the queue into main with commit 0d57f6a Nov 25, 2024
20 checks passed
andrewsignori-aot added a commit that referenced this pull request Nov 25, 2024
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.
andrewsignori-aot added a commit that referenced this pull request Nov 25, 2024
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.
andrewsignori-aot added a commit that referenced this pull request Nov 25, 2024
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.
@andrewsignori-aot andrewsignori-aot deleted the fix/#3667-bull-global-initialization-lock-sync branch November 25, 2024 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants