Skip to content

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

Open
@mojixcoder

Description

@mojixcoder

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()
	})
}

Metadata

Metadata

Assignees

Labels

defectSuspected defect such as a bug or regressionstaleThis issue has had no activity in a while

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions