Skip to content

Fix critical bugs: syslog writer, duplicate types, background launch timeout, race condition, memory leak #60

Description

@laolusrael

Critical Bug Fixes

1. Syslog Writer is a No-Op

File: \�pi/internal/logger/logger.go:127-129
go func (s *syslogWriter) Write(p []byte) (n int, err error) { return len(p), nil // Discards all log output! }
Impact: When syslog output is configured, all logs are silently discarded.

2. Duplicate TypeScript Type Definitions

File: \ui/src/lib/types/instance.ts\

  • \InstanceState\ defined as type union (line 99-106) and as interface (line 132-135)
  • \SnapshotList\ defined twice (lines 120-122 and 137-139)
    Impact: Type confusion, potential runtime errors.

3. No Timeout on Background Launch

File: \�pi/internal/multipass/client.go:401
go cmd := exec.Command(multipass, args...) // No context, no timeout
Impact: If multipass hangs, the goroutine blocks indefinitely, leaking resources.

4. Race Condition in Job Storage

File: \�pi/internal/handlers/job_storage.go
Set() calls save() which reads s.jobs under RLock, but between Unlock and save(), another goroutine could modify the map.
Impact: Potential data corruption or lost job updates.

5. Memory Leak from Store Subscriptions

File: \ui/src/routes/+page.svelte:16-18
typescript instances.loading.subscribe((l) => (loading = l)); // Never unsubscribed
Impact: Memory leak on component unmount.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions