Permalink
Browse files

Change default exitcodes= to 0. Refs #1153

  • Loading branch information...
mnaberez committed Sep 28, 2018
1 parent abef0a2 commit 837c159ae51f3bf12c1d30a8cb44f3450611983c
View
@@ -19,6 +19,12 @@
a file included via ``[include]``, it will expand to the directory of
that file. Thanks to Alex Eftimie and Zoltan Toth-Czifra for the patches.
- The default value for the config file setting ``exitcodes=``, the expected
successful exit codes of a program, has changed. In previous versions, it
was ``0,2``. This caused issues with Golang programs where ``panic()``
causes the exit code to be ``2``. The default value for ``exitcodes``
is now ``0``.
- An undocumented feature where multiple ``supervisorctl`` commands could be
combined on a single line separated by semicolons has been removed.
View
@@ -755,12 +755,17 @@ where specified.
request, :program:`supervisord` will restart the process if it exits
with an exit code that is not defined in this list.
*Default*: 0,2
*Default*: 0
*Required*: No.
*Introduced*: 3.0
.. note::
In Supervisor versions prior to 4.0, the default was ``0,2``. In
Supervisor 4.0, the default was changed to ``0``.
``stopsignal``
The signal used to kill the program when a stop is requested. This
@@ -1088,7 +1093,7 @@ where specified.
autorestart=unexpected
startsecs=10
startretries=3
exitcodes=0,2
exitcodes=0
stopsignal=TERM
stopwaitsecs=10
stopasgroup=false
@@ -1344,7 +1349,7 @@ above constraints and additions.
autorestart=unexpected
startsecs=1
startretries=3
exitcodes=0,2
exitcodes=0
stopsignal=QUIT
stopasgroup=false
killasgroup=false
@@ -1426,7 +1431,7 @@ above constraints and additions.
autorestart=unexpected
startsecs=1
startretries=3
exitcodes=0,2
exitcodes=0
stopsignal=QUIT
stopwaitsecs=10
stopasgroup=false
View
@@ -887,7 +887,7 @@ def get(section, opt, *args, **kwargs):
stopwaitsecs = integer(get(section, 'stopwaitsecs', 10))
stopasgroup = boolean(get(section, 'stopasgroup', 'false'))
killasgroup = boolean(get(section, 'killasgroup', stopasgroup))
exitcodes = list_of_exitcodes(get(section, 'exitcodes', '0,2'))
exitcodes = list_of_exitcodes(get(section, 'exitcodes', '0'))
# see also redirect_stderr check in process_groups_from_parser()
redirect_stderr = boolean(get(section, 'redirect_stderr','false'))
numprocs = integer(get(section, 'numprocs', 1))
@@ -76,7 +76,7 @@ serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
;startsecs=1 ; # of secs prog must stay up to be running (def. 1)
;startretries=3 ; max # of serial start failures when starting (default 3)
;autorestart=unexpected ; when to restart if exited after running (def: unexpected)
;exitcodes=0,2 ; 'expected' exit codes used with autorestart (default 0,2)
;exitcodes=0 ; 'expected' exit codes used with autorestart (default 0)
;stopsignal=QUIT ; signal used to kill process (default TERM)
;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)
;stopasgroup=false ; send stop signal to the UNIX process group (default false)
@@ -115,7 +115,7 @@ serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
;startsecs=1 ; # of secs prog must stay up to be running (def. 1)
;startretries=3 ; max # of serial start failures when starting (default 3)
;autorestart=unexpected ; autorestart if exited after running (def: unexpected)
;exitcodes=0,2 ; 'expected' exit codes used with autorestart (default 0,2)
;exitcodes=0 ; 'expected' exit codes used with autorestart (default 0)
;stopsignal=QUIT ; signal used to kill process (default TERM)
;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)
;stopasgroup=false ; send stop signal to the UNIX process group (default false)
View
@@ -518,7 +518,7 @@ def __init__(self, options, name, command, directory=None, umask=None,
stderr_syslog=False,
redirect_stderr=False,
stopsignal=None, stopwaitsecs=10, stopasgroup=False, killasgroup=False,
exitcodes=(0,2), environment=None, serverurl=None):
exitcodes=(0,), environment=None, serverurl=None):
self.options = options
self.name = name
self.command = command
@@ -552,7 +552,7 @@ def test_options(self):
self.assertEqual(proc1.stdout_logfile_maxbytes,
datatypes.byte_size('50MB'))
self.assertEqual(proc1.stdout_logfile_backups, 10)
self.assertEqual(proc1.exitcodes, [0,2])
self.assertEqual(proc1.exitcodes, [0])
self.assertEqual(proc1.directory, '/tmp')
self.assertEqual(proc1.umask, 2)
self.assertEqual(proc1.environment, dict(FAKE_ENV_VAR='/some/path'))
@@ -575,7 +575,7 @@ def test_options(self):
self.assertEqual(proc2.killasgroup, False)
self.assertEqual(proc2.stdout_logfile_maxbytes, 1024)
self.assertEqual(proc2.stdout_logfile_backups, 2)
self.assertEqual(proc2.exitcodes, [0,2])
self.assertEqual(proc2.exitcodes, [0])
self.assertEqual(proc2.directory, None)
cat3 = options.process_group_configs[2]
@@ -616,7 +616,7 @@ def test_options(self):
self.assertEqual(proc4_a.stdout_logfile_maxbytes,
datatypes.byte_size('50MB'))
self.assertEqual(proc4_a.stdout_logfile_backups, 10)
self.assertEqual(proc4_a.exitcodes, [0,2])
self.assertEqual(proc4_a.exitcodes, [0])
self.assertEqual(proc4_a.stopsignal, signal.SIGTERM)
self.assertEqual(proc4_a.stopasgroup, False)
self.assertEqual(proc4_a.killasgroup, False)
@@ -634,7 +634,7 @@ def test_options(self):
self.assertEqual(proc4_b.stdout_logfile_maxbytes,
datatypes.byte_size('50MB'))
self.assertEqual(proc4_b.stdout_logfile_backups, 10)
self.assertEqual(proc4_b.exitcodes, [0,2])
self.assertEqual(proc4_b.exitcodes, [0])
self.assertEqual(proc4_b.stopsignal, signal.SIGTERM)
self.assertEqual(proc4_b.stopasgroup, False)
self.assertEqual(proc4_b.killasgroup, False)
@@ -1834,7 +1834,7 @@ def test_options_with_environment_expansions(self):
self.assertEqual(proc1.stdout_logfile_maxbytes,
datatypes.byte_size('78KB'))
self.assertEqual(proc1.stdout_logfile_backups, 2)
self.assertEqual(proc1.exitcodes, [0,2])
self.assertEqual(proc1.exitcodes, [0])
self.assertEqual(proc1.directory, '/tmp')
self.assertEqual(proc1.umask, 2)
self.assertEqual(proc1.environment, dict(FAKE_ENV_VAR='/some/path'))
@@ -1134,7 +1134,7 @@ def test_getAllConfigInfo(self):
self.assertEqual(configs[0]['startsecs'], 10)
self.assertEqual(configs[0]['redirect_stderr'], False)
self.assertEqual(configs[0]['stdout_logfile'], 'auto')
self.assertEqual(configs[0]['exitcodes'], (0, 2))
self.assertEqual(configs[0]['exitcodes'], (0,))
self.assertEqual(configs[0]['stderr_capture_maxbytes'], 0)
self.assertEqual(configs[0]['startretries'], 999)
self.assertEqual(configs[0]['stderr_logfile_maxbytes'], 0)
@@ -1161,7 +1161,7 @@ def test_getAllConfigInfo(self):
self.assertEqual(configs[1]['startsecs'], 10)
self.assertEqual(configs[1]['redirect_stderr'], False)
self.assertEqual(configs[1]['stdout_logfile'], 'none')
self.assertEqual(configs[1]['exitcodes'], (0, 2))
self.assertEqual(configs[1]['exitcodes'], (0,))
self.assertEqual(configs[1]['stderr_capture_maxbytes'], 0)
self.assertEqual(configs[1]['startretries'], 999)
self.assertEqual(configs[1]['stderr_logfile_maxbytes'], 0)
@@ -332,7 +332,7 @@ def make_pconfig(name, command, **params):
'stopsignal': None, 'stopwaitsecs': 10,
'stopasgroup': False,
'killasgroup': False,
'exitcodes': (0,2), 'environment': None, 'serverurl': None,
'exitcodes': (0,), 'environment': None, 'serverurl': None,
}
result.update(params)
return ProcessConfig(options, **result)
@@ -398,7 +398,7 @@ def make_pconfig(name, command, **params):
'stopsignal': None, 'stopwaitsecs': 10,
'stopasgroup': False,
'killasgroup': False,
'exitcodes': (0,2), 'environment': None, 'serverurl': None,
'exitcodes': (0,), 'environment': None, 'serverurl': None,
}
result.update(params)
return EventListenerConfig(options, **result)

0 comments on commit 837c159

Please sign in to comment.