Skip to content

Fix register_from_C AttributeError in joblib workers#2264

Open
Whning0513 wants to merge 1 commit into
microsoft:mainfrom
Whning0513:fix-register-from-c-2038
Open

Fix register_from_C AttributeError in joblib workers#2264
Whning0513 wants to merge 1 commit into
microsoft:mainfrom
Whning0513:fix-register-from-c-2038

Conversation

@Whning0513

Copy link
Copy Markdown

Fix register_from_C AttributeError in joblib workers

register_from_C is called from joblib worker processes, which are forked
from the main process. In freshly spawned workers, the global config object
C is a plain Config instance (not QlibConfig), so C.registered raises
AttributeError because Config.__getattr__ falls through to raise when
the key isn't in _config dict.

The fix changes C.registered to getattr(C, 'registered', False), which
returns False for plain Config instances where the attribute doesn't exist.
This ensures the registration logic runs in worker processes rather than
silently crashing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant