Skip to content

Fix lock contention issue when reporting stream ingest warnings #6934

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

Merged
merged 1 commit into from
Jun 2, 2025

Conversation

wallyqs
Copy link
Member

@wallyqs wallyqs commented Jun 2, 2025

Reporting the stream ingest warning on high load to publishers was causing lock contention issues trying to get the stream name:

goroutine 3570823 [sync.RWMutex.RLock, 6 minutes]:
sync.runtime_SemacquireRWMutexR(0x4906aa?, 0x20?, 0xc54f06ec80?)
        runtime/sema.go:100 +0x25
sync.(*RWMutex).RLock(...)
        sync/rwmutex.go:74
github.com/nats-io/nats-server/v2/server.(*stream).name(0xc0006b4408)
        github.com/nats-io/nats-server/v2/server/stream.go:5531 +0x4c
github.com/nats-io/nats-server/v2/server.(*stream).queueInbound(0xc0006b4408, 0xc0001a0000, {0xc1ece520b0, 0x10}, {0xc489410e40, 0x26}, {0x0, 0x0, 0x0}, {0xc237180c00, ...}, ...)
        github.com/nats-io/nats-server/v2/server/stream.go:4401 +0x1e6
github.com/nats-io/nats-server/v2/server.(*stream).processInboundJetStreamMsg(0xc0006b4408, 0xc54f06ee98?, 0xc478e00488, 0x45b0eb?, {0xc1ece520b0, 0x10}, {0xc489410e40, 0x26}, {0xc47af46041, 0x200, ...})
        github.com/nats-io/nats-server/v2/server/stream.go:4777 +0x22e
github.com/nats-io/nats-server/v2/server.(*client).deliverMsg(0xc478e00488, 0x0, 0xc000334840, 0xc00023c008, {0xc47af46004, 0x10, 0x3fc}, {0xc47af46015, 0x26, 0x3eb}, ...)
        github.com/nats-io/nats-server/v2/server/client.go:3791 +0xe7e
github.com/nats-io/nats-server/v2/server.(*client).processMsgResults(0xc478e00488, 0xc00023c008, 0xc036628db0, {0xc47af46041, 0x202, 0x3bf}, {0x0, 0x0, 0x1?}, {0xc47af46004, ...}, ...)
        github.com/nats-io/nats-server/v2/server/client.go:5003 +0xda7
github.com/nats-io/nats-server/v2/server.(*client).processInboundClientMsg(0xc478e00488, {0xc47af46041, 0x202, 0x3bf})
        github.com/nats-io/nats-server/v2/server/client.go:4304 +0xc8d
github.com/nats-io/nats-server/v2/server.(*client).processInboundMsg(0xc478e00488?, {0xc47af46041?, 0x3b?, 0x3fc?})
        github.com/nats-io/nats-server/v2/server/client.go:4130 +0x37

Signed-off-by: Waldemar Quevedo [email protected]

@wallyqs wallyqs requested a review from a team as a code owner June 2, 2025 05:58
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

@neilalexander neilalexander merged commit f35e073 into main Jun 2, 2025
153 of 158 checks passed
@neilalexander neilalexander deleted the mset-name branch June 2, 2025 10:01
neilalexander added a commit that referenced this pull request Jun 17, 2025
Includes the following:

- #6922
- #6931
- #6933
- #6934
- #6939
- #6938
- #6940
- #6941
- #6942
- #6943
- #6945
- #6944
- #6947
- #6948
- #6949
- #6956
- #6960
- #6961
- #6951
- #6965
- #6968
- #6981
- #6983
- #6984

Signed-off-by: Neil Twigg <[email protected]>
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.

2 participants