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

Multiple non-persistent tailers on one queue do not always unblock #1

Closed
zalky opened this issue Apr 6, 2023 · 0 comments · Fixed by #4
Closed

Multiple non-persistent tailers on one queue do not always unblock #1

zalky opened this issue Apr 6, 2023 · 0 comments · Fixed by #4

Comments

@zalky
Copy link
Owner

zalky commented Apr 6, 2023

When more than one non-persistent tailer (any tailer without an id) are created on the same queue, only one of them will unblock.

This does not affect either persistent tailers (any tailer that has been given an id), or any tailers that participate in graphs (all tailers that particpate in graphs have an id).

Repro

The following will hang on the last line:

(let [done-1 (promise)
      done-2 (promise)
      q      (q/queue ::tmp)
      t1     (q/tailer q) ; no id given
      t2     (q/tailer q) ; no id given
      a      (q/appender q)]
  (future (deliver done-1 (q/read!! t1)))
  (future (deliver done-2 (q/read!! t2)))
  (Thread/sleep 1)
  (q/write a {:x 1})
  (= @done-2 {:x 1})
  (= @done-1 {:x 1}))

The solution is to ensure all tailers have ids: non-persistent tailers receive ephemeral ids that are not passed along on the ChronicleQueue tailer constructor.

The user facing API does not change.

zalky added a commit that referenced this issue Apr 6, 2023
This fixes a bug in blocking reads where if more than one tailer on
the same queue does not have an id, then some of those tailers may
never unblock. This is only relevant if you have more than one
non-persistent tailer (created with no id) on the same queue. This
does not affect graphs, since all tailers that particpate in graphs
always have ids.
zalky added a commit that referenced this issue Apr 6, 2023
This fixes a bug in blocking reads where if more than one tailer on
the same queue does not have an id, then some of those tailers may
never unblock. This is only relevant if you have more than one
non-persistent tailer (created with no id) on the same queue. This
does not affect graphs, since all tailers that particpate in graphs
always have ids.
@zalky zalky closed this as completed in #4 Apr 6, 2023
zalky added a commit that referenced this issue Apr 6, 2023
Fix #1 Ensure tailers always have ids for unblocking
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 a pull request may close this issue.

1 participant