-
Notifications
You must be signed in to change notification settings - Fork 263
Description
Search before asking
- I have searched the EvaDB issues and found no similar bug report.
Bug
When attempting to print the server's response to the console in interpreter.py in the read_from_client_and_send_to_server() function, it is possible to get a BlockingIOError: [Errno 35] write could not complete without blocking.
This only occurs when the server's response is large (containing a lot of text). This is an issue because the result of a query can vary in size.
The exact error:
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<read_from_client_and_send_to_server() done, defined at /Users/kumeagidi/Documents/School/Fall 2023.nosync/CS 6422/Project2/evadb/evadb/server/interpreter.py:55> exception=BlockingIOError(35, 'write could not complete without blocking', 0)>
Traceback (most recent call last):
File "/Users/kumeagidi/Documents/School/Fall 2023.nosync/CS 6422/Project2/evadb/evadb/server/interpreter.py", line 85, in read_from_client_and_send_to_server
sys.stdout.write(str(response) + "\n")
BlockingIOError: [Errno 35] write could not complete without blocking
To replicate this, run:
python3 evadb_server.py --host="0.0.0.0" --port=8803
to start the server and
python3 evadb_cmd_client.py --host="0.0.0.0" --port=8803
to start the client.
Then once you are able to type in the client, run SHOW FUNCTIONS;
. SHOW FUNCTIONS is a query that produces a large number of results. Thus it replicates this issue.
The result should be a BlockingIOError.
I investigated methods to fix this issue and I came across an asynchronous library that uses asynchronous prints called aioconsole, though I am unsure if this would resolve this issue. The relevant method in this package would be aprint().
Environment
No response
Are you willing to submit a PR?
- Yes I'd like to help by submitting a PR!