enso
enso copied to clipboard
`System.exit` does not give a chance for background threads to complete, affecting audit logs
This is probably partly by original design, but it has some unwanted consequences.
Because the audit logs are sent on a background thread, if the application exits by System.exit
, some logs may be lost because the thread is killed without a chance to finish sending them.
Fortunately, our main use case - the interactive IDE - does not rely on using System.exit
so we should be fine there. Still, batch Enso scripts, like the Test suite, may use it and ideally the logs should not be used there.
What can we do about it?
- Shall we disallow the
System.exit
command in the interactive mode altogether? i. Created a separate ticket about it as that has its own problems: #9872 - Shall we allow all threads to finish before
ExitSystemNode
calls to the JavaSystem.exit
? i. Or maybe should we allow to create 'protected' threads that are registered somewhere and are allowed to finish before the exit?