Previously, we were using the close event handler for the query server child process(es). This did not always properly handle the case where the child query server process crashed, because close is only emitted after all stdio streams of the child process are closed (see back-linked issue).
This PR handles the exit and error processes instead: exit is emitted even if child process stdio streams are still open. Note that the documentation indicates that exit may still fire after error, so this change includes some simple logic to make sure that we only restart the query server once if both fire.
Checklist
[x] CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
[x] Issues have been created for any UI or other user-facing changes made by this pull request.
[x] [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.
Previously, we were using the
close
event handler for the query server child process(es). This did not always properly handle the case where the child query server process crashed, becauseclose
is only emitted after all stdio streams of the child process are closed (see back-linked issue).This PR handles the
exit
anderror
processes instead:exit
is emitted even if child process stdio streams are still open. Note that the documentation indicates thatexit
may still fire aftererror
, so this change includes some simple logic to make sure that we only restart the query server once if both fire.Checklist
ready-for-doc-review
label there.