Description
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.