You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When calling subscription.Drain followed by subscription.StatusChanged, the current status is read from inside StatusChanged outside a mutex, but written inside changeSubStatus, inside the mutex, which causes a data race.
Expected behavior
I expect the status read and write to be serialized.
Server and client version
github.com/nats-io/nats.go v1.38.0
Host environment
No response
Steps to reproduce
No response
The text was updated successfully, but these errors were encountered:
Hello @AndrewDK, thanks for creating the issue. You're right, that is a potential race, I'll look into it.
AndrewDK
changed the title
Data race between subscription.StatusChanged and changeSubStatus.changeSubStatus
Data race between subscription.StatusChanged and subscription.changeSubStatus
Mar 11, 2025
Observed behavior
When calling subscription.Drain followed by subscription.StatusChanged, the current status is read from inside StatusChanged outside a mutex, but written inside changeSubStatus, inside the mutex, which causes a data race.
Expected behavior
I expect the status read and write to be serialized.
Server and client version
github.com/nats-io/nats.go v1.38.0
Host environment
No response
Steps to reproduce
No response
The text was updated successfully, but these errors were encountered: