-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Synapse exits with zero exit code on config error #4640
Comments
Obviously, this is problematic for |
(This is still the case) |
I've tested blowing up synapse in the config and setup stages while running it as a python module and it's exit code's were correct. The problem is with sycntl, it swallows the error codes. The simple solution is to have a non-zero error code if it fails to start something. However, syctl can simultaneously try to start up a number of workers of which only a subset might fail. It's unclear whether the command should be considered a complete failure in this case because there will be workers running after it is executed. I presume this was intentional because it allows synapse to limp along. I think the cleanest solution would be to have two error codes. One if sycntl was a complete failure and the other if only a subset failed. I propose 1 and 4 respectively. |
I definitely wasn't thinking of synctl when I wrote this. Perhaps it's been fixed since... |
It does not appear to have been fixed since. I have misconfigured my synapse so that it has: listeners:
- port: 8
type: http
tls: true
resources:
- names: [client, federation] I get:
|
Looks like this is due to us binding ports after having started the reactor, at which point we always return with 0. Errors in the config parsing do return with a non-zero error code because that happens before we start the reactor. |
If synapse cannot bind to a TCP socket, or there is an error in the listeners config, synapse exits with a zero exit code even if it is configured not to daemonize.
It looks like it doesn't actually exit when
sys.exit(1)
is called but rather does a bunch of cleanup and forgets the exit code in the meantimeThe text was updated successfully, but these errors were encountered: