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

feat: increase default Python recursion limit #207

Closed
1JunGu opened this issue Oct 25, 2022 · 3 comments
Closed

feat: increase default Python recursion limit #207

1JunGu opened this issue Oct 25, 2022 · 3 comments
Labels
wontfix This will not be worked on

Comments

@1JunGu
Copy link

1JunGu commented Oct 25, 2022

Describe the bug
Server initialization failed. Message: Error sending result: '<fortls.parse_fortran.FortranFile object at 0x7fddce1c8d60>'. Reason: 'RecursionError('maximum recursion depth exceeded while calling a Python object')'

To Reproduce
Initialising Language Server for workspace: *.F with command-line options: --enable_code_actions, --hover_signature, --use_signature_help, --lowercase_intrinsics, --nthreads=4, --incremental_sync

Alternatively, you can try and describe the steps that you followed to encounter the bug:

  1. Download fortls using conda, and download Modern Fortran in VS code
  2. open my program directory, and click a Fortran file with suffix ".F"
  3. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots & Animations
If applicable, add screenshots or GIF/MP4 animations to help explain your problem.

Setup information (please complete the following information):

  • OS: Mac intel 2020
  • Python Version: 3.9
  • fortls Version: 2.13.0
  • Code editor used: VS Code
  • the Fortran extension for the code editor and its version: Modern Fortran v3.2.0
@1JunGu 1JunGu added the bug Something isn't working label Oct 25, 2022
@1JunGu
Copy link
Author

1JunGu commented Oct 25, 2022

Maybe the workspace is too large and the stack is too deep?

@1JunGu
Copy link
Author

1JunGu commented Oct 25, 2022

I probably solve this question temporarily.

  1. I add sys.setrecursionlimit(3000) in the fortls shell command.
  2. delete some unnecessary codes (may be a lot).

Then I restart the workspace, the Modern Fortran wouldn't issue any errors! Thanks for your excellent software for Fortran programmer!

@gnikit
Copy link
Member

gnikit commented Oct 25, 2022

Yeah, I don't think we can change the recursion limit since it would greatly affect the performance and memory consumption of the language server. I don't remember the specifics on this but when I run into this around a year ago there was a non-trivial reason as to why I could not change it for fortls.

Having said that I don't think this is a bug. It could be considered a feature request, but for me to consider it seriously I would need to know the size of the code base and some info for a MWE. I don't feel comfortable changing the recursion limit (by default 1000) unless there are practical usecases and fortls' performance has been benchmarked before and after.

@gnikit gnikit removed the bug Something isn't working label Oct 25, 2022
@gnikit gnikit changed the title some issues related The Modern Fortran extension in VS code feat: increase default Python recursion limit Oct 25, 2022
@gnikit gnikit added the wontfix This will not be worked on label Nov 1, 2022
@gnikit gnikit closed this as completed Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants