Closed GeorgeVelocity closed 1 year ago
What happened: Panic occurred when the context is canceled:
E0503 19:14:23.280014 19253 retrywatcher.go:130] "Watch failed" err="context canceled" panic: send on closed channel goroutine 324 [running]: github.com/stern/stern/stern.Run.func3() /home/runner/go/pkg/mod/github.com/stern/stern@v1.23.0/stern/stern.go:190 +0x1aa created by github.com/stern/stern/stern.Run /home/runner/go/pkg/mod/github.com/stern/stern@v1.23.0/stern/stern.go:179 +0xcea
What you expected to happen: Not to panic when the context is canceled
How to reproduce it (as minimally and precisely as possible): Initialize stern.Config and run the following:
stern.Config
ctx := context.WithCancel(context.Background()) go func() { <-time.After(5 * time.Second) cancel() }() stern.Run(ctx, config)
Anything else we need to know?: There is actually a race condition so the described bug doesn't always occur. It happens because the error channel is closed without waiting for go routine to finish
Environment:
stern --version
cat /etc/os-release
Thank you for reporting! I believe this issue will be resolved in #267.
What happened: Panic occurred when the context is canceled:
What you expected to happen: Not to panic when the context is canceled
How to reproduce it (as minimally and precisely as possible): Initialize
stern.Config
and run the following:Anything else we need to know?: There is actually a race condition so the described bug doesn't always occur. It happens because the error channel is closed without waiting for go routine to finish
Environment:
stern --version
):cat /etc/os-release
):