Commit e230be5
fix(audience-http): propagate caller cancellation from SendBatchAsync
Addresses PR #701 review from @nattb8.
The catch-filter branch for caller cancellation used to silently swallow
the exception and let the method return `true` — its normal "batch sent,
ask me again" signal. FlushAsync's send loop takes that return value at
face value and immediately re-enters on the same cancelled token.
HttpClient throws on entry (token still cancelled), the same branch
swallows it, `true` is returned again. The batch is never deleted on
this path, so ReadBatch keeps handing back the same events — a tight
infinite loop.
Rethrow instead. The caller's send loop exits via the exception; no
behaviour change for HttpClient's internal timeout path (still filtered
out by the `when (ct.IsCancellationRequested)` guard) so timeouts still
trigger backoff.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e1ec7eb commit e230be5
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
138 | 143 | | |
139 | 144 | | |
140 | 145 | | |
| |||
0 commit comments