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

The dedicated service ocis nats server runs panic when stopping. #10360

Closed
2403905 opened this issue Oct 21, 2024 · 2 comments · Fixed by #10363
Closed

The dedicated service ocis nats server runs panic when stopping. #10360

2403905 opened this issue Oct 21, 2024 · 2 comments · Fixed by #10363
Labels

Comments

@2403905
Copy link
Contributor

2403905 commented Oct 21, 2024

Describe the bug

The dedicated service ocis nats server runs panic when stopping.

Steps to reproduce

  1. Run ocis/bin/ocis nats server
  2. Stop control + c

Expected behavior

The service stopped. No errors.

Actual behavior

$ ocis/bin/ocis nats server
2024/10/21 12:48:55 ERROR failed to set GOMEMLIMIT package=github.com/KimMachineGun/automemlimit/memlimit error="failed to set GOMEMLIMIT: cgroups is not supported on this system"
^C{"level":"error","service":"nats","time":"2024-10-21T12:49:09+02:00","message":"Shutting down server"}
panic: close of nil channel

goroutine 1 [running]:
github.com/nats-io/nats-server/v2/server.(*Server).shutdownEventing(0xc0006c0888)
	/Users/roman/go/pkg/mod/github.com/nats-io/nats-server/[email protected]/server/events.go:1738 +0x166
github.com/nats-io/nats-server/v2/server.(*Server).Shutdown(0xc0006c0888)
	/Users/roman/go/pkg/mod/github.com/nats-io/nats-server/[email protected]/server/server.go:2430 +0x52
github.com/owncloud/ocis/v2/services/nats/pkg/server/nats.(*NATSServer).Shutdown(...)
	/Users/roman/projects/owncloud/ocis/services/nats/pkg/server/nats/nats.go:48
github.com/owncloud/ocis/v2/services/nats/pkg/command.Server.func2.3({0x0, 0x0})
	/Users/roman/projects/owncloud/ocis/services/nats/pkg/command/server.go:106 +0x74
github.com/oklog/run.(*Group).Run(0xc00181f3c8)
	/Users/roman/go/pkg/mod/github.com/oklog/[email protected]/group.go:47 +0x17d
github.com/owncloud/ocis/v2/services/nats/pkg/command.Server.func2(0xc000f8c8c0)
	/Users/roman/projects/owncloud/ocis/services/nats/pkg/command/server.go:110 +0xb5e
github.com/urfave/cli/v2.(*Command).Run(0xc0014ac6e0, 0xc000f8c8c0, {0xc0012a48d0, 0x1, 0x1})
	/Users/roman/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:276 +0x97d
github.com/urfave/cli/v2.(*Command).Run(0xc0014acb00, 0xc00144a680, {0xc001411ea0, 0x2, 0x2})
	/Users/roman/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:269 +0xbb7
github.com/urfave/cli/v2.(*Command).Run(0xc0014b7b80, 0xc00144a5c0, {0xc00011c780, 0x3, 0x3})
	/Users/roman/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:269 +0xbb7
github.com/urfave/cli/v2.(*App).RunContext(0xc0005b9c00, {0x1068cee00, 0xc00144a480}, {0xc00011c780, 0x3, 0x3})
	/Users/roman/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:333 +0x5a5
github.com/owncloud/ocis/v2/ocis/pkg/command.Execute()
	/Users/roman/projects/owncloud/ocis/ocis/pkg/command/root.go:32 +0x1ea
main.main()
	/Users/roman/projects/owncloud/ocis/ocis/cmd/ocis/main.go:11 +0x13
@2403905
Copy link
Contributor Author

2403905 commented Oct 21, 2024

@kobergj The nats server itself runs signal handling that the Shutdown() call in the ocis code is redundant.
Or we can turn the nats signal handling off natsOpts.NoSigs = true and keep the Shutdown() on ower own control.
What do you prefer?

https://github.com/nats-io/nats-server/blob/5fba928d21cd8fee0e5924f90e39f0bc8d39b5d5/server/server.go#L904

@kobergj
Copy link
Collaborator

kobergj commented Oct 21, 2024

Both solutions are fine for me. If you have a strong opinion go for it. Otherwise let's just use natsOpts.NoSigs = true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants