Open alcarney opened 1 month ago
This is also an issue for WebSockets.
Traceback (most recent call last):
File "/var/home/alex/Projects/openlawlibrary/pygls/options/pygls/protocol/json_rpc.py", line 391, in _send_data
self.transport.write(body) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/home/alex/Projects/openlawlibrary/pygls/options/pygls/server.py", line 142, in write
asyncio.ensure_future(self._ws.send(data))
File "/usr/lib64/python3.12/asyncio/tasks.py", line 693, in ensure_future
loop = events.get_event_loop()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/asyncio/events.py", line 702, in get_event_loop
raise RuntimeError('There is no current event loop in thread %r.'
RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0'.
501 seems to have found an interesting bug.
When a server
The following logs are taken from
tests/e2e/test_threaded_handler.py
(reordered slightly to help tell the story better)test_countdown_threaded
The server receives the
count.down.thread
command from the clientThe server starts its countdown
Interestingly, the client appears to receive the first notification!
But then the server immediately raises a
RuntimeError
.But the server still attempts to communicate with the client
But for some reason the client never recieves any of the messages and the test case hangs indefinitely
test_countdown_blocking
For comparison, here are the logs when executing the
test_countdown_blocking
test case. The server sends the messages and the client receives them as expected. (Although for some reason all at once? Perhaps just a quirk of the logging approach?? :thinking:)Questions