Skip to content

[Reliability] Unchecked resource close errors — potential resource leaks #6

Description

@YHQZ1

Multiple Close() calls throughout the codebase drop their error return. While these rarely crash, unhandled close errors mask resource leaks. golangci-lint reports these as errcheck violations (22 total across all services).
Affected — API:

cmd/server/main.go:26 — db.Close()
internal/auth/github.go:104, 132 — resp.Body.Close()
internal/handlers/github.go:71 — resp.Body.Close()
internal/ws/hub.go:37 — conn.Close()
internal/ws/hub.go:60 — sub.Close()

Affected — Builder:

internal/queue/worker.go:105 — os.RemoveAll(buildPath)
internal/queue/worker.go:159, 162 — w.ch.Close(), w.conn.Close()

Affected — Deployer:

internal/queue/worker.go:176 — rows.Close()
internal/queue/worker.go:210, 213, 216 — w.db.Close(), w.ch.Close(), w.conn.Close()

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — fix this sprintReliabilityCorrectness / uptime issuegood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions