Skip to content

Blocking I/O in MessageBus init #569

@agners

Description

@agners

Describe the bug
blockbuster found that this library is doing blocking I/O in the MessageBus constructor:

Traceback (most recent call last):
  File "/usr/src/supervisor/supervisor/dbus/manager.py", line 125, in load
    self._bus = connected_bus = await MessageBus(
                                      ~~~~~~~~~~^
        bus_type=BusType.SYSTEM
        ^^^^^^^^^^^^^^^^^^^^^^^
    ).connect()
    ^
  File "/usr/local/lib/python3.13/site-packages/dbus_fast/aio/message_bus.py", line 209, in __init__
    super().__init__(bus_address, bus_type, ProxyObject, negotiate_unix_fd)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/dbus_fast/message_bus.py", line 176, in dbus_fast.message_bus.BaseMessageBus.__init__
  File "src/dbus_fast/message_bus.py", line 747, in dbus_fast.message_bus.BaseMessageBus._setup_socket
  File "src/dbus_fast/message_bus.py", line 709, in dbus_fast.message_bus.BaseMessageBus._setup_socket
  File "/usr/local/lib/python3.13/site-packages/blockbuster/blockbuster.py", line 109, in wrapper
    raise BlockingError(func_name)
blockbuster.blockbuster.BlockingError: Blocking call to socket.socket.connect

It seems the library is calling socket.connect() in _setup_socket.

To Reproduce
Connect to D-Bus with blockbuster enabled.

Additional context

Metadata

Metadata

Assignees

No one assigned

    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