Commit 09eccb0
Fix Netty ByteBuf leak in GatewayServerErrorInjector fault injection delay paths (#48880)
When fault injection simulates a response delay, the real HTTP response body
was discarded without draining its ByteBuf content. Under HTTP/2, this causes
ByteBuf leaks that accumulate on the long-lived parent channel.
Two leak paths fixed:
- delay >= timeout: doOnNext drains body before delayElement buffers it
- delay < timeout: doOnDiscard releases body if downstream cancels during delay
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 388debe commit 09eccb0
2 files changed
Lines changed: 23 additions & 1 deletion
File tree
- sdk/cosmos
- azure-cosmos-test
- azure-cosmos/src/main/java/com/azure/cosmos/implementation/faultinjection
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| 178 | + | |
177 | 179 | | |
178 | 180 | | |
179 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
180 | 187 | | |
181 | | - | |
| 188 | + | |
| 189 | + | |
182 | 190 | | |
183 | 191 | | |
184 | 192 | | |
| |||
243 | 251 | | |
244 | 252 | | |
245 | 253 | | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
246 | 267 | | |
0 commit comments