altdesktop / python-dbus-next

🚌 The next great DBus library for Python with asyncio support
https://python-dbus-next.readthedocs.io/en/latest/
MIT License
187 stars 58 forks source link

UNIX FD leaks #162

Open gollux opened 4 weeks ago

gollux commented 4 weeks ago

When negotiate_unix_fds is enabled on the MessageBus, the library starts leaking file descriptors.

This happens for example when an unhandled message is received, or if the message is handled by any of the builtin handlers which are not aware of file descriptor passing. The only way to avoid the leaks seems to be installing a custom message handler, which handles messages that need file descriptors, and close all file descriptors in message.unix_fds otherwise, so that they never get to the default handlers.

elParaguayo commented 3 weeks ago

I think I'm running in to this too.

Could you share your custom handler for closing these?

FYI this project seems to be unmaintained so I suspect this won't get picked up.