Skip to content

[bug] Failed to cleanup fake proxy error ignored #2104

@docker-agent

Description

@docker-agent

🟡 medium - bug

File: cmd/root/run.go (line 167)

Code

defer func() {
	if err := fakeCleanup(); err != nil {
		slog.Error("Failed to cleanup fake proxy", "error", err)
	}
}()

Problem

The error returned by fakeCleanup() is logged but not returned to the caller. This could lead to silent failures where resources are not properly cleaned up, but the program continues to execute as if everything is fine. While slog.Error logs the issue, the main execution flow might not be aware of it, potentially leading to resource leaks or unexpected behavior in long-running processes.

Suggested Fix

Similar to the recordCleanup() issue, if the cleanup is critical, the error should be propagated. Otherwise, acknowledge that it's intentionally logged and ignored.


Found by nightly codebase scan

Metadata

Metadata

Assignees

No one assigned

    Labels

    automatedIssues created by cagentkind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions