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

Panic when calling server.Start() after shutting down the server. #4789

Open
mojixcoder opened this issue Nov 12, 2023 · 1 comment · May be fixed by #4792
Open

Panic when calling server.Start() after shutting down the server. #4789

mojixcoder opened this issue Nov 12, 2023 · 1 comment · May be fixed by #4792
Assignees
Labels
defect Suspected defect such as a bug or regression stale This issue has had no activity in a while

Comments

@mojixcoder
Copy link

mojixcoder commented Nov 12, 2023

Observed behavior

Panics when calling server.Start() again after a successful shutdown.

Expected behavior

Shouldn't panic when calling server.Start() again after a successful shutdown.

Server and client version

v2.10.5

Host environment

Mac

Steps to reproduce

import natsserver "github.com/nats-io/nats-server/v2/test"

func TestPanics(t *testing.T) {
	s := natsserver.RunServer(&natsserver.DefaultTestOptions)

	s.Shutdown()

	assert.PanicsWithError(t, "close of closed channel", func() {
		s.Start()
	})
}
@mojixcoder mojixcoder added the defect Suspected defect such as a bug or regression label Nov 12, 2023
@mojixcoder
Copy link
Author

mojixcoder commented Nov 12, 2023

It happened to me when I updated my nats-server from v2.1.9 to v2.10.5.

I think it's because of this line: https://github.com/nats-io/nats-server/blob/main/server/server.go#L2343.

derekcollison added a commit that referenced this issue Nov 13, 2023
Signed-off-by: Derek Collison <derek@nats.io>
@derekcollison derekcollison self-assigned this Nov 13, 2023
@github-actions github-actions bot added the stale This issue has had no activity in a while label Mar 18, 2024
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 stale This issue has had no activity in a while
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants