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

Add flush after copy during downloads #2460

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

sswguo
Copy link
Member

@sswguo sswguo commented Sep 5, 2024

Trying to fix MMENG-4207 Inconsistent large downloads

Adding the flush ensures that all the data is sent to the client after the copy is complete. Without an explicit flush(), some data might remain in the buffer and not be sent until it's full.

Copy link
Contributor

@pkocandr pkocandr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed the cout is not closed anywhere in the code, so that's probably when flush happens normally without enforcing it. Although not sure how CountingOutputStream is implemented and if it is necessary to close it.

@sswguo
Copy link
Member Author

sswguo commented Dec 2, 2024

Merging this for further tests, and to see if we need to explicitly close it too. thanks.

@sswguo sswguo merged commit 16f1016 into Commonjava:master Dec 2, 2024
1 check passed
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