Commit 6a6c0c6
committed
Fix poison pill bug: Make retry heap unbounded
Remove max size constraint from retry heap to prevent deadlock when
failing log groups exceed concurrency limit.
Changes:
- Remove maxSize and semaphore from retryHeap struct
- Make Push() non-blocking (no semaphore wait)
- Remove semaphore release from PopReady()
- Update NewRetryHeap() to ignore maxSize parameter (kept for API compatibility)
- Update TestRetryHeap_SemaphoreBlockingAndUnblocking -> TestRetryHeap_UnboundedPush
- Update TestRetryHeapSmallerThanFailingLogGroups to validate fix
Before: With concurrency=2 and 10 failing log groups, retry heap (size=2)
would fill up, causing workers to block on Push(), leading to deadlock.
After: Retry heap is unbounded, allowing all failed batches to be queued
without blocking workers. Allowed log groups continue publishing normally.
Test results:
- TestRetryHeapSmallerThanFailingLogGroups: PASS (5/5 allowed batches published)
- Heap grew to size 28 (beyond concurrency limit of 2)
- No deadlock or starvation1 parent fd28e8e commit 6a6c0c6
4 files changed
Lines changed: 47 additions & 92 deletions
File tree
- plugins/outputs/cloudwatchlogs/internal/pusher
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
Lines changed: 10 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
| 180 | + | |
| 181 | + | |
184 | 182 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 183 | + | |
| 184 | + | |
189 | 185 | | |
190 | | - | |
191 | | - | |
192 | 186 | | |
193 | 187 | | |
194 | 188 | | |
195 | | - | |
| 189 | + | |
196 | 190 | | |
197 | 191 | | |
198 | 192 | | |
| |||
237 | 231 | | |
238 | 232 | | |
239 | 233 | | |
240 | | - | |
241 | 234 | | |
242 | 235 | | |
243 | 236 | | |
| |||
255 | 248 | | |
256 | 249 | | |
257 | 250 | | |
258 | | - | |
259 | 251 | | |
260 | 252 | | |
261 | 253 | | |
| |||
313 | 305 | | |
314 | 306 | | |
315 | 307 | | |
316 | | - | |
| 308 | + | |
317 | 309 | | |
318 | | - | |
| 310 | + | |
319 | 311 | | |
320 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
321 | 315 | | |
322 | 316 | | |
323 | 317 | | |
| |||
Lines changed: 16 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
63 | | - | |
| 61 | + | |
64 | 62 | | |
65 | 63 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
71 | 67 | | |
72 | 68 | | |
73 | 69 | | |
74 | 70 | | |
75 | 71 | | |
76 | | - | |
| 72 | + | |
77 | 73 | | |
78 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
79 | 77 | | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | 78 | | |
101 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
102 | 83 | | |
103 | 84 | | |
104 | 85 | | |
| |||
113 | 94 | | |
114 | 95 | | |
115 | 96 | | |
116 | | - | |
117 | | - | |
118 | 97 | | |
119 | 98 | | |
120 | 99 | | |
| |||
Lines changed: 20 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
| 148 | + | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
158 | 160 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
166 | 168 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
183 | 172 | | |
184 | 173 | | |
185 | 174 | | |
186 | 175 | | |
187 | | - | |
| 176 | + | |
188 | 177 | | |
189 | | - | |
| 178 | + | |
190 | 179 | | |
191 | 180 | | |
192 | 181 | | |
193 | 182 | | |
194 | 183 | | |
195 | 184 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
207 | 188 | | |
208 | 189 | | |
209 | 190 | | |
| |||
0 commit comments