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

jetstream: ordered consumer: handle closed subscriptions gracefully #1666

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zonque
Copy link

@zonque zonque commented Jun 25, 2024

In orderedConsumer.reset(), retryWithBackoff() is returned from with false, nil in case the subscription is closed. In this case, var cons Consumer is still nil, and the code crashes in the attempt to cast it to a pullConsumer later on.

Fix this by catching the nil case explicitly.

Signed-off-by: Daniel Mack daniel.mack@holoplot.com

@zonque
Copy link
Author

zonque commented Jun 25, 2024

Closes #1656

@zonque zonque changed the title jetstream: ordered consumer: handled closed subscriptions gracefully jetstream: ordered consumer: handle closed subscriptions gracefully Jun 25, 2024
@zonque zonque force-pushed the daniel/ordered-consumer-closed branch from 32fb4da to f28e14a Compare June 25, 2024 13:01
In `orderedConsumer.reset()`, `retryWithBackoff()` is returned from with
`false, nil` in case the subscription is closed. In this case,
`var cons Consumer` is still `nil`, and the code crashes in the attempt to
cast it to a `pullConsumer` later on.

Fix this by catching the `nil` case explicitly.

Signed-off-by: Daniel Mack <daniel.mack@holoplot.com>
@zonque zonque force-pushed the daniel/ordered-consumer-closed branch from f28e14a to 1de5b00 Compare June 25, 2024 15:33
@zonque
Copy link
Author

zonque commented Jun 25, 2024

This is a regression from 66b92a9 it appears.

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.

None yet

1 participant