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

JS Push consumers crash the process when the NATS server goes away #1371

Open
OtaK opened this issue Feb 13, 2025 · 3 comments
Open

JS Push consumers crash the process when the NATS server goes away #1371

OtaK opened this issue Feb 13, 2025 · 3 comments
Labels
defect Suspected defect such as a bug or regression

Comments

@OtaK
Copy link

OtaK commented Feb 13, 2025

Observed behavior

When the NATS JS server goes away (connectivity issue, etc), the owning process gets crashed because there's an unwrap here:

context.client.state.changed().await.unwrap();

Expected behavior

Not crashing the owning process

Server and client version

latest for both

Host environment

N/A

Steps to reproduce

No response

@OtaK OtaK added the defect Suspected defect such as a bug or regression label Feb 13, 2025
@Jarema
Copy link
Member

Jarema commented Feb 18, 2025

Thanks for the report.
Will issue a fix for it.

@Jarema
Copy link
Member

Jarema commented Feb 18, 2025

Do you happen to have reproduction example?
I'm not sure how State Sender can be dropped (and cause a panic) if the whole client is not being dropped.

@OtaK
Copy link
Author

OtaK commented Feb 24, 2025

My repro is using a NATS KV watch_all operation (which creates a push consumer under the hood) and having the NATS server be SIGKILL'd, this creates this panic.

At the same time even if the client is dropped as a whole it shouldn't panic its owning thread either way, because this prevents graceful recovery

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

2 participants