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

Check for sys being ready before calling sysRequest #6200

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

wallyqs
Copy link
Member

@wallyqs wallyqs commented Dec 3, 2024

This should prevent the following from happening during shutdown:

[1] 2024/11/30 23:09:21.559476 [DBG] JETSTREAM - JetStream connection closed: Client Closed
[1] 2024/11/30 23:09:21.561754 [DBG] JETSTREAM - JetStream connection closed: Client Closed
fatal error: sync: Unlock of unlocked RWMutex
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xcde26b]
goroutine 623 [running]:
sync.fatal({0x12c1d0a?, 0xc040000000?})
	/root/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.8.linux-amd64/src/runtime/panic.go:1007 +0x18
sync.(*RWMutex).Unlock(0xc0000db7e4)
	/root/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.8.linux-amd64/src/sync/rwmutex.go:208 +0x7e
panic({0x11e5780?, 0x1b73560?})
	/root/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.22.8.linux-amd64/src/runtime/panic.go:770 +0x132
github.com/nats-io/nats-server/v2/server.(*Server).newRespInbox(0xc000225008)
	server/events.go:2742 +0x6b
github.com/nats-io/nats-server/v2/server.sysRequest[...](0xc000225008, {0x12af980, 0xd}, {0xc000665d30, 0x2, 0x2})
	server/jetstream_cluster.go:6335 +0xea
github.com/nats-io/nats-server/v2/server.(*Server).jsClusteredStreamUpdateRequest(0xc000225008, 0xc00068c000, 0xc00022a2c8, {0xc0007ad7a0, 0x21}, {0xc00052cfa8, 0x11}, {0xc000598840, 0x2ab, 0x2ab}, ...)
	server/jetstream_cluster.go:6545 +0x1505
created by github.com/nats-io/nats-server/v2/server.(*Server).jsStreamUpdateRequest in goroutine 149
	server/jetstream_api.go:1729 +0xdcb
goroutine 1 [chan receive, 1 minutes]:
github.com/nats-io/nats-server/v2/server.(*Server).WaitForShutdown(...)
	server/server.go:2694

Signed-off-by: Waldemar Quevedo <wally@nats.io>
@wallyqs wallyqs requested a review from a team as a code owner December 3, 2024 01:49
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit d94bfed into main Dec 3, 2024
5 checks passed
@derekcollison derekcollison deleted the sys-req-shutdown branch December 3, 2024 05:04
neilalexander added a commit that referenced this pull request Dec 3, 2024
Includes:

- #6200
- #6202

Signed-off-by: Neil Twigg <neil@nats.io>
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