Skip to content

fix(config): avoid recursion when loading a custom config - #189

Merged
EtienneWallet merged 2 commits into
developfrom
fix/config_load_recursion
Jun 9, 2026
Merged

fix(config): avoid recursion when loading a custom config#189
EtienneWallet merged 2 commits into
developfrom
fix/config_load_recursion

Conversation

@EtienneWallet

Copy link
Copy Markdown
Contributor

Summary

Loading a custom config file through Config.get_config() (for example MXOPS_CONFIG=deployment/mxops_config.ini mxops data get -n devnet --path) crashed with RecursionError: maximum recursion depth exceeded.

The data path is resolved while the _Config singleton is still being constructed, and that resolution calls Config.get_config() again. Because the singleton instance is not assigned until the constructor returns, the re-entrant call builds another _Config, which resolves the data path again — looping indefinitely. Any config resolution performed during _Config.__init__ re-enters the half-built singleton.

Changes

  • _Config.__init__ no longer resolves the data path (or any other configuration) while constructing the config, removing the re-entrant call.

Testing

  • Added a regression test exercising the full Config.get_config() singleton path with a custom config set via MXOPS_CONFIG, asserting it resolves without recursing.
  • Verified end to end: MXOPS_CONFIG=<custom>.ini mxops data get -n devnet --path now resolves the custom data path successfully.
  • Full unit suite passes (319 tests); ruff, flake8, bandit clean; pylint 10.00/10.

EtienneWallet and others added 2 commits June 9, 2026 13:25
Resolving the data path during logger setup re-enters Config.get_config() while the singleton is still being constructed, causing infinite recursion. Remove logging from _Config.__init__ and add a regression test exercising the full Config.get_config() path with a custom config.
@EtienneWallet
EtienneWallet merged commit 0f331ae into develop Jun 9, 2026
@EtienneWallet
EtienneWallet deleted the fix/config_load_recursion branch June 9, 2026 11:41
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