faust-streaming / faust

Python Stream Processing. A Faust fork
https://faust-streaming.github.io/faust/
Other
1.65k stars 183 forks source link

v0.10.0 fails to launch with `Future <Future pending> attached to a different loop` #417

Closed DBBrowne closed 1 year ago

DBBrowne commented 1 year ago

Checklist

Steps to reproduce

Tell us what you did to cause something to happen.

run faust agent with faust version 0.10.0

Expected behavior

See faust 0.9.5

Actual behavior

RuntimeError: Task <Task pending name=‘Task-14’ coro=<Event.wait() running at /usr/local/lib/python3.8/asyncio/locks.py:309> cb=[_wait.<locals>._on_completion() at /usr/local/lib/python3.8/asyncio/tasks.py:515]> got Future <Future pending> attached to a different loop

Does not occur with faust v0.9.5

Full traceback

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
2022-11-30 10:16:39.090 | INFO     | mode.utils.logging:log:280 - [^-App]: Flush producer buffer...
2022-11-30 10:16:39.092 | INFO     | mode.utils.logging:log:280 - [^--TableManager]: Stopping...
2022-11-30 10:16:39.094 | INFO     | mode.utils.logging:log:280 - [^---Fetcher]: Stopping...
2022-11-30 10:16:39.099 | INFO     | mode.utils.logging:log:280 - [^---Conductor]: Stopping...
2022-11-30 10:16:39.101 | INFO     | mode.utils.logging:log:280 - [^--AgentManager]: Stopping...
2022-11-30 10:16:39.103 | INFO     | mode.utils.logging:log:280 - [^--ReplyConsumer]: Stopping...
2022-11-30 10:16:39.105 | INFO     | mode.utils.logging:log:280 - [^--LeaderAssignor]: Stopping...
2022-11-30 10:16:39.107 | INFO     | mode.utils.logging:log:280 - [^--Consumer]: Stopping...
2022-11-30 10:16:39.112 | INFO     | mode.utils.logging:log:280 - [^--Web]: Stopping...
2022-11-30 10:16:39.114 | INFO     | mode.utils.logging:log:280 - [^---ServerThread]: Stopping...
    self.run()
  File "/usr/local/lib/python3.8/site-packages/mode/threads.py", line 61, in run
    self.service._start_thread()
  File "/usr/local/lib/python3.8/site-packages/mode/threads.py", line 209, in _start_thread
    self.thread_loop.run_until_complete(self._serve())
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/site-packages/mode/threads.py", line 252, in _serve
    await self.wait_until_stopped()
  File "/usr/local/lib/python3.8/site-packages/mode/services.py", line 999, in wait_until_stopped
    await self.wait()
  File "/usr/local/lib/python3.8/site-packages/mode/services.py", line 713, in wait
    await self._wait_stopped(timeout=timeout)
  File "/usr/local/lib/python3.8/site-packages/mode/services.py", line 794, in _wait_stopped
    fut.result()  # propagate exceptions
  File "/usr/local/lib/python3.8/asyncio/locks.py", line 309, in wait
    await fut
RuntimeError: Task <Task pending name='Task-14' coro=<Event.wait() running at /usr/local/lib/python3.8/asyncio/locks.py:309> cb=[_wait.<locals>._on_completion() at /usr/local/lib/python3.8/asyncio/tasks.py:515]> got Future <Future pending> attached to a different loop

Versions

wbarnha commented 1 year ago

Currently working on a fix, see https://github.com/faust-streaming/mode/issues/33.

wbarnha commented 1 year ago

Just released mode-streaming==0.3.2, give that a try. I was able to reproduce the issue on my end and now the issue should be fixed. Sorry for the inconvenience.

DBBrowne commented 1 year ago

Thanks for the fast response. We'll take a look when we can.