Commit 4cb6517
Fix IMAP connection exhaustion under burst of searches
IMAP read/mutation operations opened a fresh connection per call and closed
it via Dispose() without a graceful LOGOUT. Lingering connections plus repeated
AUTHENTICATE attempts hit Gmail's per-account connection limit/throttle, stalling
subsequent AUTHENTICATE calls so rapid searches hung for the full timeout.
Reuse a single authenticated IMAP connection per account behind a per-account
gate, with NOOP health-check, reconnect-and-retry on a broken reused connection,
and graceful DisconnectAsync(true) on eviction/shutdown via IAsyncDisposable.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent ab78887 commit 4cb6517
3 files changed
Lines changed: 347 additions & 111 deletions
File tree
- changelogs
- src/CalendarMcp.Core/Providers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
0 commit comments