Skip to content

Bump recursion limit to match CPython's - #2959

Closed
DimitrisJim wants to merge 1 commit into
RustPython:mainfrom
DimitrisJim:bump_recursion_limit
Closed

DimitrisJim wants to merge 1 commit into
RustPython:mainfrom
DimitrisJim:bump_recursion_limit

Conversation

@DimitrisJim

Copy link
Copy Markdown
Member

This was set in #1477 to 512 though 1000 appears to easily be supported as a default. This matches the value currently used by CPython and closes #2948

@DimitrisJim

Copy link
Copy Markdown
Member Author

Locally, this is fine. Seems like the test runners aren't able to handle it though. Closing for now since I'm pretty sure 1000 is considered an implementation detail at the end of the day.

@youknowone

Copy link
Copy Markdown
Member

https://docs.python.org/3/library/sys.html#sys.setrecursionlimit

I think default value can be 1000 and we can override it for CI

@DimitrisJim

DimitrisJim commented Aug 25, 2021 •

Copy link
Copy Markdown
Member Author

But where would I set it? The only place I can think of is in the failing function along with a TODO: comment explaining things.

@youknowone

Copy link
Copy Markdown
Member

I am thinking of Lib/test/__init__.py with environment variable check

@DimitrisJim DimitrisJim reopened this Aug 25, 2021
Comment thread Lib/test/test_threading.py Resolved
@DimitrisJim
DimitrisJim force-pushed the bump_recursion_limit branch 2 times, most recently from 5d7cfe8 to d822964 Compare August 25, 2021 11:53
@DimitrisJim
DimitrisJim force-pushed the bump_recursion_limit branch from d822964 to a68c521 Compare August 25, 2021 12:22
@DimitrisJim

Copy link
Copy Markdown
Member Author

I cant diagnore the issue here. Trying to set the recursion limit doesn't seem to do the trick either.

@youknowone

youknowone commented Aug 27, 2021 •

Copy link
Copy Markdown
Member

I think sys.setrecursionlimit in RustPython doesn't work perfectly. It copies the value to threads, but I think sys.recursionlimit is a shared value between threads

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.

python-speed failing to run

2 participants