Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wait until all data in buffer is flushed to client #1362

Closed
wants to merge 2 commits into from

Conversation

YK-Samgo
Copy link
Contributor

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. Then proxy will mistake this shutdown as server 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:

          1000M              10000M+
client ==== proxy.py ==== upstream 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.

@abhinavsingh
Copy link
Owner

@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

@abhinavsingh
Copy link
Owner

@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 #1385

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants