matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: Memory leak in IMAP IDLE connection management

Open andrinoff opened this issue 7 months ago • 2 comments

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 #617 but more complex
  • Requires goroutine leak detection
  • May need runtime.NumGoroutine() instrumentation
  • Severity: Medium-High - resource leak over time
  • Complexity: High - concurrency debugging

andrinoff avatar Apr 16 '26 20:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 17 '26 05:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar May 31 '26 06:05 floatpanebot