Wait until all data in buffer is flushed to client #1362
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.