Streaming API handlers may panic when apiserver shuts down
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-core |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
The apiserver tracks the number of active API requests (using a WaitGroup) and when shutting down waits for them to finish before stopping. This WaitGroup is incremented only for Juju normal RPC API but not for non-standard ("streaming") API requests. This means that the goroutines servicing such requests can still be active when the apiserver has closed it *state.State, causing "Session already closed" panics.
This issue has been resolved for the /logsink and /log API handlers (https:/
It should be noted that panics in API handlers aren't fatal as the server infrastructure catches the panic and just emits a stack trace. They are however alarming to users and developers.
Changed in juju-core: | |
status: | New → Triaged |
tags: | added: api |
Changed in juju-core: | |
status: | Triaged → Won't Fix |
Can we just emit the stacktrace if DEBUG or even TRACE level logging is activated? My preference is for TRACE.