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

Compact buffer when writable bytes drop below a set low watermark #266

Merged
merged 4 commits into from
Dec 4, 2017

Conversation

ali-ince
Copy link
Contributor

@ali-ince ali-ince commented Dec 4, 2017

Internal buffer used by ChunkedReader was not being reset (its recorded positions) under edge cases, where Read operation on NetworkStream was given a count of 0 which was conceived as an Unexpected end of stream.

This PR addresses this problem by checking the number of writable bytes left in the buffer against a pre-defined constant value of 1024 and when drops under this value, the buffer positions are reset and leftover bytes are copied to the beginning of the buffer.

Related with the discussion on Introduce network level write throttling #10433 and might be related to #250.

@AviAvni
Copy link

AviAvni commented Dec 4, 2017

@ali-ince I downloaded this code and compiled it and it's solve the problem I reported

@zhenlineo zhenlineo merged commit 5e5f75d into neo4j:1.5 Dec 4, 2017
@ali-ince ali-ince deleted the 1.5-fix-buffer-compact branch December 4, 2017 13:42
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.

None yet

3 participants