matcha
matcha copied to clipboard
BUG: Memory leak in IMAP IDLE connection management
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:
- Connect to IMAP account with IDLE enabled
- Switch accounts multiple times
- Monitor goroutines - count increases
- 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
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.
Closing due to inactivity. Reopen if still relevant.