Commit cc5e9cc
committed
fix(qwp): Error inside upgrade-failure catch arm leaks the connected client
The catch (HttpClientException) arm ran QwpUpgradeFailures.classify()
before newClient.close(). The sibling catch (Error) added in 1582e3a
does not guard catch-arm bodies, so an Error thrown inside classify
(it allocates on the role-reject/auth paths) escaped with the client's
fd and native buffers open -- the exact leak 1582e3a set out to close.
Reorder: close before classify. Safe -- classify reads only heap
fields (upgradeRejectRole/Zone, upgradeStatusCode) that are set during
upgrade() and are not cleared by close(). The arm now has a
zero-allocation window ahead of close().1 parent 0f3d3d3 commit cc5e9cc
1 file changed
Lines changed: 8 additions & 1 deletion
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2768 | 2768 | | |
2769 | 2769 | | |
2770 | 2770 | | |
2771 | | - | |
| 2771 | + | |
| 2772 | + | |
| 2773 | + | |
| 2774 | + | |
| 2775 | + | |
| 2776 | + | |
| 2777 | + | |
2772 | 2778 | | |
| 2779 | + | |
2773 | 2780 | | |
2774 | 2781 | | |
2775 | 2782 | | |
| |||
0 commit comments