You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
InspectionTaskRunner instances are never deleted or cleaned up #808
Currently, once an inspection is created via POST /api/v3/inspection/types/:typeID, the generated InspectionTaskRunner instance remains in the server's memory indefinitely until the backend restarts.
Furthermore, GET /api/v3/inspection (the list endpoint used by the UI) filters instances using if inspection.Started() (pkg/server/server.go). Since an inspection's Started() status only becomes true when a full Run() is initiated, any inspections that were created solely for DryRun() validation (or abandoned prior to running) are invisible in the UI, yet they permanently occupy space in the backend's memory map.
Current Behavior
When an inspection is created, InspectionTaskServer registers it in inspections map[string]*InspectionTaskRunner (pkg/core/inspection/server.go).
There is no delete() operation or cleanup endpoint for the inspections map.
Running DryRun() does not set the runner field or prune the runner.
As a result, abandoned or dry-run inspections accumulate silently in memory without any visibility in the UI.
Proposed Solutions
We should introduce a lifecycle management mechanism for inspection runners. Ideas include:
Explicit Deletion API: Provide a DELETE /api/v3/inspection/:inspectionID endpoint.
Automatic Cleanup (TTL / GC): Implement a background worker in InspectionTaskServer to purge idle or un-started inspection runners after a configurable duration of inactivity.
Activity