Commit 12f4b2a
authored
Cancel replaced timeouts to avoid leak (AsyncHttpClient#1732)
Fix for issue AsyncHttpClient#1731.
When setting the TimeoutHolder, cancel any prior timeout so that they don't leak.
Previously, they would just be lost and remain in the timer until their timeout expired, which could be a long time. Previously, encountering a redirect would trigger this code, causing the old request timer to be replaced with a new one. The old timer would maintain a link back to this Future, but couldn't be canceled by this future (as its reference had been overwritten) causing the Future, is associated Response, and any AsyncResponseHandler to be retained in memory instead of being garbage collected once the request had been processed.1 parent b9b8836 commit 12f4b2a
File tree
1 file changed
+4
-1
lines changed- client/src/main/java/org/asynchttpclient/netty
1 file changed
+4
-1
lines changedLines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
370 | 373 | | |
371 | 374 | | |
372 | 375 | | |
| |||
0 commit comments