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

Pass lock timeout to primed_async #624

Merged

Conversation

millerjs
Copy link
Contributor

relates to #617

There is an issue where an integer config.timeout was being
respected in pop_queued, but the promise in primed_async was only
waiting the config.ttl plus the drift.

This means that high latency redis connections will return a nil
primed_jid and while_executing jobs will get dropped.

The proposed solution is to ensure that config.timeout gets passed in
as the wait argument to the bound method(:primed_async), which
allows the Concurrent::Promises to timeout after the same duration
(plus drift) as the brpoplpush call.

The issue triage and approach is documented in:

relates to mhenrixon#617

There is an issue where an integer `config.timeout` was being
respected in `pop_queued`, but the promise in `primed_async` was only
waiting the `config.ttl` plus the drift.

This means that high latency redis connections will return a `nil`
`primed_jid` and while_executing jobs will get dropped.

The proposed solution is to ensure that `config.timeout` gets passed in
as the `wait` argument to the bound `method(:primed_async)`, which
allows the `Concurrent::Promises` to timeout after the same duration
(plus drift) as the `brpoplpush` call.

The issue triage and approach is documented in:

  - mhenrixon#617 (comment)
  - mhenrixon#617 (comment)
  - mhenrixon#617 (comment)
@millerjs millerjs mentioned this pull request Jul 20, 2021
Copy link
Owner

@mhenrixon mhenrixon left a comment

Choose a reason for hiding this comment

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

Stellar research and stellar implementation! I'll get this released as soon as possible!

I have been staring at this problem for so long without understanding what could possibly be wrong.

@millerjs
Copy link
Contributor Author

Thanks and thanks for the great gem!!

@mhenrixon mhenrixon merged commit 76cfc92 into mhenrixon:master Jul 21, 2021
@mhenrixon
Copy link
Owner

mhenrixon added a commit that referenced this pull request Jul 28, 2021
Locking mechanism was broken in #624.
mhenrixon added a commit that referenced this pull request Jul 28, 2021
* Fix UntilAndWhileExecuting

Locking mechanism was broken in #624.

* Bump appraisals

* Simplify access
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.

2 participants