Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase recursion limit and add error handling for deep recursion of… #747

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

pankajskku
Copy link
Member

@pankajskku pankajskku commented Oct 27, 2024

… ASTs

This commit raises the recursion limit to 10000 to accommodate deeper recursive operations in the AST parsing process. Additionally, it introduces try-except blocks to catch and handle recursion errors gracefully, ensuring the program can recover and continue processing when the recursion depth exceeds the newly set limit. This approach enhances the robustness of our AST traversal by preventing abrupt terminations due to recursion depth issues.

Why are these changes needed?

I found code snippets in the WCA EPT data whose ASTs lead to a deeper recursion and violate the default recursion Python limit of 3000. These are mostly long string concatenation operations. As they are not the syntactic concept of interest, I am ignoring them.

Related issue number (if any).

@pankajskku
Copy link
Member Author

pankajskku commented Oct 27, 2024

@touma-I
Hello Maroun,

This commit raises the recursion limit to 10000 to accommodate deeper recursive operations in the AST parsing process. Additionally, it introduces try-except blocks to catch and handle recursion errors gracefully, ensuring the program can recover and continue processing when the recursion depth exceeds the newly set limit. This approach enhances the robustness of our AST traversal by preventing abrupt terminations due to recursion depth issues.
Please review it at your convenience.

I put this message because the option to add a reviewer is disabled for me.
image

Thank You.

… ASTs

This commit raises the recursion limit to 10000 to accommodate deeper recursive operations in the AST parsing process. Additionally, it introduces try-except blocks to catch and handle RecursionErrors gracefully, ensuring the program can recover and continue processing when the recursion depth exceeds the newly set limit. This approach enhances the robustness of our AST traversal by preventing abrupt terminations due to recursion depth issues.

Signed-off-by: Pankaj Thorat <[email protected]>
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