Skip to content

[L7] Snowflake async continuation uses uncancelable context, leaks on shutdown #296

Description

@pradeepto

Severity: Low

Category

Reliability

Files

cmd/main.go:432-485

Description

startSnowflakeAsyncContinuation launches a background goroutine that fetches remaining Snowflake users after preload. This goroutine:

  • Uses context.Background() at line 442 so it is never canceled even when the manager stops
  • Has no mechanism to report completion status to the health check
  • If it fails silently (line 474) reconciliation will encounter cache misses for those users which could cause duplicate user creation in Snowflake
  • Individual cache write failures at line 459 are logged but swallowed

Fix

Use a context derived from the manager's context so the goroutine gets canceled on shutdown. Add completion/error reporting that the health probe can check.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions