Skip to content

Pass lock timeout to primed_async#624

Merged
mhenrixon merged 1 commit intomhenrixon:masterfrom
millerjs:resolve-promise-brpoplpush-contingency
Jul 21, 2021
Merged

Pass lock timeout to primed_async#624
mhenrixon merged 1 commit intomhenrixon:masterfrom
millerjs:resolve-promise-brpoplpush-contingency

Conversation

@millerjs
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

Thanks and thanks for the great gem!!

@mhenrixon mhenrixon merged commit 76cfc92 into mhenrixon:master Jul 21, 2021
@mhenrixon
Copy link
Copy Markdown
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