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

Fix panic when closing nats connection #4016

Merged
merged 2 commits into from
Jun 28, 2023

Conversation

gmgigi96
Copy link
Member

@gmgigi96 gmgigi96 commented Jun 28, 2023

Fixes this panic:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10d6188]

goroutine 1 [running]:
github.com/nats-io/nats%2ego.(*Conn).Drain(0x0)
        /home/gianmaria/go/pkg/mod/github.com/nats-io/[email protected]/nats.go:5190 +0x28
github.com/cs3org/reva/pkg/notification/notificationhelper.(*NotificationHelper).Stop(0xc000282f00)
        /home/gianmaria/Documenti/CERN/reva2/pkg/notification/notificationhelper/notificationhelper.go:124 +0x29
github.com/cs3org/reva/internal/http/services/owncloud/ocdav.(*svc).Close(0xc0007ca300)
        /home/gianmaria/Documenti/CERN/reva2/internal/http/services/owncloud/ocdav/ocdav.go:188 +0x34
github.com/cs3org/reva/pkg/rhttp.(*Server).closeServices(0xc0002180e0)
        /home/gianmaria/Documenti/CERN/reva2/pkg/rhttp/rhttp.go:154 +0xb7
github.com/cs3org/reva/pkg/rhttp.(*Server).Stop(0xc0002180e0)
        /home/gianmaria/Documenti/CERN/reva2/pkg/rhttp/rhttp.go:142 +0x45
github.com/cs3org/reva/cmd/revad/pkg/grace.(*Watcher).TrapSignals(0xc00098b790)
        /home/gianmaria/Documenti/CERN/reva2/cmd/revad/pkg/grace/grace.go:475 +0x9fd
github.com/cs3org/reva/cmd/revad/runtime.(*Reva).Start(0xc000368140)
        /home/gianmaria/Documenti/CERN/reva2/cmd/revad/runtime/runtime.go:238 +0x358
main.runSingle(0xc000719e80, {0xc00003f900, 0x33})
        /home/gianmaria/Documenti/CERN/reva2/cmd/revad/main.go:238 +0x266
main.runConfigs({0xc0005364a0, 0x1, 0x1})
        /home/gianmaria/Documenti/CERN/reva2/cmd/revad/main.go:217 +0x70
main.main()
        /home/gianmaria/Documenti/CERN/reva2/cmd/revad/main.go:89 +0x491

This was happening when the connection to nats server was not yet established, and a close to the notification service was triggered.

@gmgigi96 gmgigi96 requested a review from a team as a code owner June 28, 2023 09:41
@cs3org cs3org deleted a comment from update-docs bot Jun 28, 2023
@glpatcern glpatcern merged commit 63cd6aa into cs3org:master Jun 28, 2023
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