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

[FIXED] Ephemeral PullConsumer's Fetch() would fail with "no responders" #1022

Merged
merged 2 commits into from
Jul 29, 2022

Conversation

bruth
Copy link
Member

@bruth bruth commented Jul 29, 2022

This was a bug @piotrpio found where passed consumer name (assuming a durable) was being used to define the "next message" subject. This resets it if an ephemeral was created using the server-generated name.

@coveralls
Copy link

coveralls commented Jul 29, 2022

Coverage Status

Coverage increased (+0.4%) to 84.468% when pulling 726f0d8 on bruth:patch-1 into f4a86f3 on nats-io:main.

js.go Outdated
@@ -1662,6 +1662,7 @@ func (js *js) subscribe(subj, queue string, cb MsgHandler, ch chan *Msg, isSync,
// after the AddConsumer returns.
if consumer == _EMPTY_ {
sub.jsi.consumer = info.Name
sub.jsi.nms = fmt.Sprintf(js.apiSubj(apiRequestNextT), stream, info.Name)
Copy link
Member

Choose a reason for hiding this comment

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

We should probably do that under condition of if isPullMode {}.

Copy link
Member

Choose a reason for hiding this comment

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

+1 setting the next message subject here would not have side effects for push consumers but better to guard it to be under the check for pull mode just in case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added the guard.

Signed-off-by: Byron Ruth <[email protected]>
Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@kozlovic kozlovic left a comment

Choose a reason for hiding this comment

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

LGTM

@kozlovic kozlovic changed the title Use consumer name in subject for ephemeral [FIXED] Ephemeral PullConsumer's Fetch() would fail with "no responders" Jul 29, 2022
@kozlovic kozlovic merged commit dcf9b93 into nats-io:main Jul 29, 2022
@bruth bruth deleted the patch-1 branch July 29, 2022 18:54
@bruth
Copy link
Member Author

bruth commented Jul 29, 2022

Thanks!

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.

4 participants