Skip to content
New issue

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

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

Already on GitHub? # to your account

Unify critical session running in hls #4251

Closed
soulomoon opened this issue May 26, 2024 · 2 comments · May be fixed by soulomoon/haskell-language-server#16
Closed

Unify critical session running in hls #4251

soulomoon opened this issue May 26, 2024 · 2 comments · May be fixed by soulomoon/haskell-language-server#16
Labels

Comments

@soulomoon
Copy link
Collaborator

soulomoon commented May 26, 2024

There are some places we serialize critical session.

  • Reactor thread, running the notification handler, by running it in the reactor thread.
  • sessionLoader, we load session one by one, spawn a thread each time, and wait for the preivous thread to end.
  • sessionRestart, we runs it in seperate threads but using an MVar to do the serlization.

The latter two create a challenge for our shutdown handler to halt the hls. Since they are not cancelable.
A possible solution, would be to switch the latter two to the first approach. Create a thread specifically to run the target critical session.

@soulomoon soulomoon changed the title Unify extra thread running in hls Unify extra threads running in hls May 26, 2024
@soulomoon soulomoon changed the title Unify extra threads running in hls Unify critical session running in hls May 26, 2024
@soulomoon
Copy link
Collaborator Author

This might fix the hanging problem happend in windows
#2497

@michaelpj
Copy link
Collaborator

We did this

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants