From 19ef8df9fd00fce7426e78cb4d5877769f6f9bac Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Date: Sun, 13 Apr 2025 14:02:09 -0300 Subject: [PATCH] Check if fdshare module is enable on share_fds function --- tractor/linux/_fdshare.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tractor/linux/_fdshare.py b/tractor/linux/_fdshare.py index bc2385ef..50fc16f9 100644 --- a/tractor/linux/_fdshare.py +++ b/tractor/linux/_fdshare.py @@ -211,6 +211,13 @@ def share_fds( Register a set of fds to be shared under a given name. ''' + this_actor = tractor.current_actor() + if __name__ not in this_actor.enable_modules: + raise RuntimeError( + f'Tried to share FDs {fds} with name {name}, but ' + f'module {__name__} is not enabled in actor {this_actor.name}!' + ) + maybe_fds = maybe_get_fds(name) if maybe_fds: raise RuntimeError(f'share FDs: {maybe_fds} already tied to name {name}')