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

fix(worker): consider block timeouts less than 50ms #2455

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

roggervalf
Copy link
Collaborator

@roggervalf roggervalf commented Feb 28, 2024

ref #2450

if (member) {
return parseInt(score);
}
blockTimeout = this.blockingConnection.capabilities.canDoubleTimeout
Copy link
Contributor

@manast manast Feb 28, 2024

Choose a reason for hiding this comment

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

Actually we must have a blockTimeout that is a positive integer. The reason being that a value of 0 represents infinity, and a negative number would yield an exception. So maybe 1ms would do it? i.e. replace 0.05 by 0.001

const blockDelay = blockUntil - Date.now();
// when we reach the time to get new jobs
if (blockDelay < 1) {
return 0.001;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

looks like it will be only needed when blockDelay is less than 1 when getting a marker from a delayed job, wdyt @manast

Copy link
Contributor

@manast manast left a comment

Choose a reason for hiding this comment

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

Ok, lets try this approach.

@roggervalf roggervalf merged commit 2de15ca into master Mar 1, 2024
11 checks passed
@roggervalf roggervalf deleted the fix-consider-delays-less-than-50-ms branch March 1, 2024 05:07
github-actions bot pushed a commit that referenced this pull request Mar 1, 2024
## [5.4.1](v5.4.0...v5.4.1) (2024-03-01)

### Bug Fixes

* **worker:** set blockTimeout as 0.001 when reach the time to get delayed jobs ([#2455](#2455)) fixes [#2450](#2450) ([2de15ca](2de15ca))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants