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

Fix language server causing random crashes when use_threads is enabled #99861

Merged

Conversation

Ryan-000
Copy link
Contributor

For a few years, I’ve been experiencing random crashes in VS Code when saving GDScript files, and after a long time troubleshooting, I finally found the root cause.

The issue was that ScriptEditor::reload_scripts was being called directly on the language server thread when network/language_server/use_thread was enabled. This led to race conditions that would eventually cause the crashes.

@Ryan-000 Ryan-000 requested a review from a team as a code owner November 30, 2024 00:47
@Ryan-000 Ryan-000 force-pushed the Fix-language-server-thread-crash branch from e6a4c17 to 1fb39a0 Compare November 30, 2024 01:12
@dalexeev dalexeev added this to the 4.4 milestone Nov 30, 2024
@Ryan-000 Ryan-000 force-pushed the Fix-language-server-thread-crash branch from 1aaab5a to 3439575 Compare November 30, 2024 22:07
@Ryan-000 Ryan-000 force-pushed the Fix-language-server-thread-crash branch from 141c6ae to c3d1ff0 Compare December 2, 2024 15:23
Co-Authored-By: Adam Scott <ascott.ca@gmail.com>
Co-Authored-By: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
@Ryan-000 Ryan-000 force-pushed the Fix-language-server-thread-crash branch from c3d1ff0 to 8dd330d Compare December 2, 2024 15:31
@adamscott adamscott changed the title Fix language server causing random crashes when use_threads is enabled Fix language server causing random crashes when use_threads is enabled Dec 2, 2024
@Repiteo Repiteo merged commit cb1b743 into godotengine:master Dec 3, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Dec 3, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants