-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix buffer issues with async IPC; add tests #3492
Conversation
800b091
to
751dd72
Compare
- Move to a readline() approach on the stream reader for IPC. The older implementation for the original IPC would read in chunks but this isn't ideal and, it turns out, opting for readline while allowing control of the buffer limit lends itself quite nicely to plucking well-formed responses from the socket.
751dd72
to
91cb2d5
Compare
I wonder if chunks can arrive in arbitrary order. Also this thread discusses possible solutions. |
dfc96b0
to
4ee81d3
Compare
- Document ``read_buffer_limit`` on the ``AsyncIPCProvider`` class. - Add ``ReadBufferLimitReached`` exception to be raised when the read buffer limit is reached, prompting the user to increase the limit. - Add a base ``PersistentConnectionError`` exception class for persistent connection errors to inherit from.
4ee81d3
to
8504dd9
Compare
@raxhvl thanks for reporting. I believe this will be a more straightforward approach that can give control to the user to configure the read buffer limit if needs to be even larger than the default of 20MB. This should resolve your issues and I added a test to test this limit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a couple questions to take or leave, but generally looks good to me! Much cleaner! 🧹
- Also inherit from ``Web3ValueError`` for ``ReadBufferLimitReached``. - Properly assert the response for configured read limit test.
What was wrong?
Closes #3485
How was it fixed?
readline()
approach on the stream reader for IPC. The older implementation for the original IPC would read in chunks but this isn't ideal and, it turns out, opting for readline while allowing control of the buffer limit lends itself quite nicely to plucking well-formed responses from the socket.Todo:
Cute Animal Picture