Closed YK-Samgo closed 2 months ago
@YK-Samgo Thank you for the PR, and apologies for delaying the merge, was away from OSS for long. I have restarted the workflows and shall merge once after they passed. Best
@YK-Samgo Thanks a ton for pointing out this issue. I have cherry-picked your commit into this PR and made further enhancements. Would appreciate if you can review https://github.com/abhinavsingh/proxy.py/pull/1385
Wait until all data in buffer is flushed to client when upstream server finishes.
This bug is met after #1361
With high performance upstream and large memory,
proxy
will keep a lot of data in buffer, and the upstream link may be closed by upstream server. Thenproxy
will mistake this shutdown asserver tear down
and kill the whole work even though there is still data in buffer.I think it's more graceful to wait until all data flushed to client in this case.
This is a performance-related and random issue. I think it's also the reason of #498
In my server:
May be there is a similar issue when upload large file, but I didn't meet. Or it won't be a problem since client will wait until response.
The bug #1361 will slow down the upstream so it will never be faster than client, which avoid the issue.