👌 Add configuration for recursion limit in workers #6044
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
daemon.recursion_limit
config option which, only if specifically set by the user, will change the recursion limit within the worker Python interpreter.Addresses #4876
As specified, currently no change is made without a user specifically setting the config option, meaning that the default 1000 limit will be used.
It could be an option to set a specific (higher) default for this option.
This has precedent, for example if one opens an IPython terminal session you will find the limit actually set at 3000, since jedi resets the limit: https://github.com/davidhalter/jedi/blob/a28bd24befa4331101d151df10445367de8df16a/jedi/api/__init__.py#L48
The Python 1000 default limit is quite conservative, and given IPython doesn't have an issue with 3000, this should be fine, although setting it too high may lead to stack overflow errors, since Python doesn't handle recursion in a particular efficiently (memory-wise).