Skip to content

BUG: Memory leak in IMAP IDLE connection management #633

@andrinoff

Description

@andrinoff

Describe the bug: IDLE watchers accumulate over time. When switching accounts or reconnecting, old goroutines may not terminate properly. No cleanup verification in StopAllAndWait().

To reproduce:

  1. Connect to IMAP account with IDLE enabled
  2. Switch accounts multiple times
  3. Monitor goroutines - count increases
  4. Old IDLE watchers remain active

Expected behavior: All goroutines should terminate when StopAll() called. Verify with goroutine count decrease.

Additional context:

  • File: fetcher/idle.go
  • Related to race condition in BUG: Potential race condition in IDLE watcher Stop() #617 but more complex
  • Requires goroutine leak detection
  • May need runtime.NumGoroutine() instrumentation
  • Severity: Medium-High - resource leak over time
  • Complexity: High - concurrency debugging

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingchore

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions