Skip to content

Agent Shutdown may cause panic #111

@sanha

Description

@sanha

After an agent is shutdown, enqueueStat may cause a nil pointer panic.
https://github.com/pinpoint-apm/pinpoint-go-agent/blob/main/agent.go#L673C1-L683C2

I don't know where exactly calling enqeueStat, but it should be protected to calling a closed agent. (or, ignore the call in enqueueStat)

panic: send on closed channel

goroutine 9347 [running]:
github.com/pinpoint-apm/pinpoint-go-agent.(*agent).enqueueStat(...)
        /home1/irteamsu/work/pkg/mod/github.com/pinpoint-apm/[email protected]/agent.go:675
github.com/pinpoint-apm/pinpoint-go-agent.(*agent).sendUrlStatWorker(0xc0002cc640)
        /home1/irteamsu/work/pkg/mod/github.com/pinpoint-apm/[email protected]/agent.go:667 +0x1f6
created by github.com/pinpoint-apm/pinpoint-go-agent.(*agent).connectGrpcServer in goroutine 9298
        /home1/irteamsu/work/pkg/mod/github.com/pinpoint-apm/[email protected]/agent.go:227 +0x305

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions