Fix container remove timeouts and make force-remove reliable.
Release rolling / release (push) Successful in 9m13s
Release rolling / release (push) Successful in 9m13s
Lifecycle RPCs now use a 120s operation timeout, remove cleans up stats/terminal/log streams then SIGKILLs before force-remove, and the UI awaits the request instead of a fragile 30s wait race.
This commit is contained in:
@@ -266,6 +266,26 @@ function destroyStatsEntry(id) {
|
||||
statsCache.delete(id)
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop live stats stream for a container before stop/remove so Docker is not
|
||||
* held open by NDJSON stats attachments (can delay force-remove).
|
||||
* @param {string} id
|
||||
*/
|
||||
export function destroyStatsForContainer(id) {
|
||||
if (!id) return
|
||||
const needle = String(id)
|
||||
destroyStatsEntry(needle)
|
||||
for (const key of Object.keys(containerStats)) {
|
||||
if (key === needle) continue
|
||||
if (
|
||||
(needle.length >= 12 && key.startsWith(needle)) ||
|
||||
(key.length >= 12 && needle.startsWith(key.slice(0, Math.min(12, key.length))))
|
||||
) {
|
||||
destroyStatsEntry(key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function collectContainerStats() {
|
||||
// Running only for streams; we still list all so stopped ids are cleaned up
|
||||
const running = await docker.listContainers({ all: false })
|
||||
|
||||
Reference in New Issue
Block a user