User Request
Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: 8e838c8b-8903-4d72-bebd-4306dc6c0bf2
Description
What happened:
In pkg/api/handlers/exec.go:451-519, after StreamWithContext returns, HandleExec writes the exit message and returns without waiting for the reader goroutine to finish via <-done. The reader goroutine's cleanup (close(stdinCh), execCancel()) happens asynchronously after the handler returns. The exit message write and the reader's next ReadMessage call have no ordering guarantee.
What I expected:
<-done should be awaited before writing the exit message to ensure the reader goroutine has exited and cleanup is ordered correctly.
Steps to reproduce:
- Run an exec session and end it
- Observe the exit message is written while the reader goroutine may still be active
- Observe cleanup ordering issues in the reader goroutine
This issue was automatically created from the KubeStellar Console.
User Request
Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: 8e838c8b-8903-4d72-bebd-4306dc6c0bf2
Description
What happened:
In
pkg/api/handlers/exec.go:451-519, afterStreamWithContextreturns,HandleExecwrites the exit message and returns without waiting for the reader goroutine to finish via<-done. The reader goroutine's cleanup (close(stdinCh),execCancel()) happens asynchronously after the handler returns. The exit message write and the reader's nextReadMessagecall have no ordering guarantee.What I expected:
<-doneshould be awaited before writing the exit message to ensure the reader goroutine has exited and cleanup is ordered correctly.Steps to reproduce:
This issue was automatically created from the KubeStellar Console.