Skip to content

Errors with python3.11 with concurrency and high event rates #419

Open
@krzysieksulejczak

Description

Checklist

  • I have included information about relevant versions
  • I have verified that the issue persists when using the master branch of Faust.

Steps to reproduce

I tried to switch to python3.11, I used faust-streaming==0.10.0 and mode-streaming==0.3.2. The application started but the agent started throwing errors and eventually died.

Expected behavior

The agent should process messages without errors.

Actual behavior

see tracebacks below

Full traceback

[2022-12-02 14:13:47,323] [1] [ERROR] [^--Consumer]: Drain messages raised: TypeError('Passing coroutines is forbidden, use tasks explicitly.')
Traceback (most recent call last):
  File "/app/venv/lib/python3.11/site-packages/faust/transport/consumer.py", line 1200, in _drain_messages
    await self.wait_first(
  File "/app/venv/lib/python3.11/site-packages/mode/services.py", line 769, in wait_first
    f.result()  # propagate exceptions
    ^^^^^^^^^^
  File "/app/venv/lib/python3.11/site-packages/faust/transport/conductor.py", line 274, in on_message
    return await get_callback_for_tp(message.tp)(message)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "faust/transport/_cython/conductor.pyx", line 78, in __call__
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 415, in wait
    raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
[2022-12-02 14:13:47,326] [1] [ERROR] [^---Fetcher]: Crashed reason=TypeError('Passing coroutines is forbidden, use tasks explicitly.')
Traceback (most recent call last):
  File "/app/venv/lib/python3.11/site-packages/mode/services.py", line 853, in _execute_task
    await task
  File "/app/venv/lib/python3.11/site-packages/faust/transport/consumer.py", line 177, in _fetcher
    await consumer._drain_messages(self)
  File "/app/venv/lib/python3.11/site-packages/faust/transport/consumer.py", line 1200, in _drain_messages
    await self.wait_first(
  File "/app/venv/lib/python3.11/site-packages/mode/services.py", line 769, in wait_first
    f.result()  # propagate exceptions
    ^^^^^^^^^^
  File "/app/venv/lib/python3.11/site-packages/faust/transport/conductor.py", line 274, in on_message
    return await get_callback_for_tp(message.tp)(message)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "faust/transport/_cython/conductor.pyx", line 78, in __call__
  File "/usr/local/lib/python3.11/asyncio/tasks.py", line 415, in wait
    raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
[2022-12-02 14:13:48,369] [1] [WARNING] [^----OneForOneSupervisor: (8@0x7f5854dd16d0)]: Max restarts exceeded: MaxRestartsExceeded()
Traceback (most recent call last):
  File "/app/venv/lib/python3.11/site-packages/mode/supervisors.py", line 181, in restart_service
    async with self._bucket:
  File "/app/venv/lib/python3.11/site-packages/mode/utils/times.py", line 149, in __aenter__
    raise self.raises()
mode.exceptions.MaxRestartsExceeded
[2022-12-02 14:13:48,370] [1] [ERROR] [^----OneForOneSupervisor: (8@0x7f5854dd16d0)]: Crashed reason=SystemExit(1)
Traceback (most recent call last):
  File "/app/venv/lib/python3.11/site-packages/mode/supervisors.py", line 181, in restart_service
    async with self._bucket:
  File "/app/venv/lib/python3.11/site-packages/mode/utils/times.py", line 149, in __aenter__
    raise self.raises()
mode.exceptions.MaxRestartsExceeded

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/venv/lib/python3.11/site-packages/mode/services.py", line 853, in _execute_task
    await task
  File "/app/venv/lib/python3.11/site-packages/mode/supervisors.py", line 141, in _supervisor
    await self.restart_services(to_restart)
  File "/app/venv/lib/python3.11/site-packages/mode/supervisors.py", line 165, in restart_services
    await self.restart_service(service)
  File "/app/venv/lib/python3.11/site-packages/mode/supervisors.py", line 191, in restart_service
    raise SystemExit(1)
SystemExit: 1

Versions

  • Python version: 3.11
  • Faust version: 0.10.0
  • Operating system: Debian bullseye

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions