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

Proper way to stop a cn-infra app? #370

Closed
sush-abc opened this issue Jan 13, 2019 · 4 comments
Closed

Proper way to stop a cn-infra app? #370

sush-abc opened this issue Jan 13, 2019 · 4 comments
Assignees
Labels

Comments

@sush-abc
Copy link

sush-abc commented Jan 13, 2019

Is there a preferred way to stop the application built on cn-infra platform? ctrl+c seems to sometimes work, but many times results in a go backtrace- which appears to abruptly halt the application.

The reason I ask this is because I'm trying to generate coverage report from the binary itself, and if the binary abruptly stops, the report is not generated.

Here's an example of when it doesn't shutdown properly:

^CINFO[0063] Signal interrupt received, stopping.          loc="agent/agent.go(185)" logger=agent
INFO[0063] Stopping agent                                loc="agent/agent.go(246)" logger=agent
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0xe56793]

goroutine 15 [running]:
github.com/project/vendor/github.com/vishvananda/netlink.(*LinkUpdate).Attrs(0xc4203199b0, 0x30)
    <autogenerated>:1 +0x33
github.com/project/vendor/github.com/ligato/vpp-agent/plugins/linux/ifplugin.(*LinuxInterfaceStateUpdater).processLinkNotification(0xc4203e5c70, 0x13b71c0, 0xc4203199b0)
    /go/src/github.com/project/vendor/github.com/ligato/vpp-agent/plugins/linux/ifplugin/interface_state.go:127 +0x4d
github.com/project/vendor/github.com/ligato/vpp-agent/plugins/linux/ifplugin.(*LinuxInterfaceStateUpdater).watchLinuxInterfaces(0xc4203e5c70, 0x13c9f40, 0xc4204138c0)
    /go/src/github.com/project/vendor/github.com/ligato/vpp-agent/plugins/linux/ifplugin/interface_state.go:115 +0x13c
created by github.com/project/vendor/github.com/ligato/vpp-agent/plugins/linux/ifplugin.(*LinuxInterfaceStateUpdater).Init
    /go/src/github.com/project/vendor/github.com/ligato/vpp-agent/plugins/linux/ifplugin/interface_state.go:64 +0x125
@VladoLavor
Copy link
Collaborator

@SUSHSADA thanks for the report, I'll look into it

@VladoLavor
Copy link
Collaborator

@SUSHSADA I guess you have used the vpp-agent dev branch (this issue is not directly related to cn-infra). I remember we fixed this issue on master/pantheon-dev (agent v1) some time ago, but dev branch contains agent v2 together with an older version of v1 where the fix was not applied.

If you are using dev branch, please try to refer to linuxv2 plugin. If you need agent v1 for some reason, use the latest master or pantheon-dev branch.

@ondrej-fabry perhaps we should consider finally removing v1 plugins and other deprecated stuff from dev.

@sush-abc
Copy link
Author

@VladoLavor Thank you for the prompt response! Sync-ing to pantheon-dev fixed this issue.

@sush-abc
Copy link
Author

Also, I had to wait until all of the plugins to Init() before being able to terminate the app properly. I found out that waiting until AfterInit() of the app/agent was executed, it was safe to ask it to shutdown.

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

No branches or pull requests

3 participants