Description
While StopServices() has logic to handle when no service is running (returns ServiceNotRunning), the state file removal in the defer at line 169 always attempts os.Remove(). This could cause errors or warnings if called multiple times in quick succession, though the error is currently ignored.
Severity
MEDIUM - Idempotency issue
Test Reference
Test: TestStopServices_Idempotent in pkg/db/db_local/stop_services_test.go:45 (skipped - requires DB)
Suggested Fix
Consider using os.RemoveAll() or checking file existence before removal.
Related Code
pkg/db/db_local/stop_services.go:163-186
Description
While
StopServices()has logic to handle when no service is running (returnsServiceNotRunning), the state file removal in the defer at line 169 always attemptsos.Remove(). This could cause errors or warnings if called multiple times in quick succession, though the error is currently ignored.Severity
MEDIUM - Idempotency issue
Test Reference
Test:
TestStopServices_Idempotentinpkg/db/db_local/stop_services_test.go:45(skipped - requires DB)Suggested Fix
Consider using
os.RemoveAll()or checking file existence before removal.Related Code
pkg/db/db_local/stop_services.go:163-186