Server should exit with non-0 on error #16476
Open
+17
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #16474 .
Just
sys.exit(process.returncode)
would be fine here, but for the sake of consistency with the rest of the code, I went for theexit_with_error
utility. The server process is expected to run for ever until stopped, so we should never get a0
exit code from the process, hence there is no need for a ternary condition here.I also went ahead and removed the bare except right above - all it did was log the error and continue, and this only hides potential errors and causes issues similar to the one I faced.
In my view, this is a bugfix, but I suppose some clients could depend on the 0 exit code here in theory? I have not familiarized with your versioning process so let me know if I should bump the patch version or something as part of this.
Help needed: Seems like the CI pipeline times out after 15 minutes. Could be my new test was "the straw that broke the camels back"? Any advice welcome.
Checklist
<link to issue>
"mint.json
.