3.0a4 (2008-01-30)

  • 3.0a3 broke Python 2.3 backwards compatibility.

  • On Debian Sarge, one user reported that a call tooptions.mktempfile would fail with an “[Errno 9] Bad filedescriptor” at supervisord startup time. I was unable toreproduce this, but we found a workaround that seemed to work forhim and it’s included in this release. Seehttp://www.plope.com/software/collector/252 for more information.Thanks to William Dode.

  • The fault ALREADY_TERMINATED has been removed. It was only raised bysupervisor.sendProcessStdin(). That method now returns NOT_RUNNINGfor parity with the other methods. (Mike Naberezny)

  • The fault TIMED_OUT has been removed. It was not used.

  • Supervisor now depends on meld3 0.6.4, which does not compile itsC extensions by default, so there is no more need to faff aroundwith NO_MELD3_EXTENSION_MODULES during installation if you don’thave a C compiler or the Python development libraries on yoursystem.

  • Instead of making a user root around for the sample.conf file,provide a convenience command “echo_supervisord_conf”, which he canuse to echo the sample.conf to his terminal (and redirect to a fileappropriately). This is a new user convenience (especially one whohas no Python experience).

  • Added numprocs_start config option to [program:x] and[eventlistener:x] sections. This is an offset used to computethe first integer that numprocs will begin to start from.Contributed by Antonio Beamud Montero.

  • Added capability for [include] config section to config format.This section must contain a single key “files”, which must name aspace-separated list of file globs that will be included insupervisor’s configuration. Contributed by Ian Bicking.

  • Invoking the reload supervisorctl command could trigger a bug insupervisord which caused it to crash. Seehttp://www.plope.com/software/collector/253 . Thanks to William Dode fora bug report.

  • The pidproxy script was made into a console script.

  • The password value in both the [inet_http_server] and[unix_http_server] sections can now optionally be specified as a SHAhexdigest instead of as cleartext. Values prefixed with {SHA} will beconsidered SHA hex digests. To encrypt a password to a form suitable forpasting into the configuration file using Python, do, e.g.:

  1. >>> import sha
  2. >>> '{SHA}' + sha.new('thepassword').hexdigest()
  3. '{SHA}82ab876d1387bfafe46cc1c8a2ef074eae50cb1d'
  • The subtypes of the events PROCESS_STATE_CHANGE (andPROCESS_STATE_CHANGE itself) have been removed, replaced with asimpler set of PROCESS_STATE subscribable event types.

The new event types are:

PROCESS_STATE_STOPPEDPROCESS_STATE_EXITEDPROCESS_STATE_STARTINGPROCESS_STATE_STOPPINGPROCESS_STATE_BACKOFFPROCESS_STATE_FATALPROCESS_STATE_RUNNINGPROCESS_STATE_UNKNOWNPROCESS_STATE # abstract

PROCESS_STATE_STARTING replaces:

PROCESS_STATE_CHANGE_STARTING_FROM_STOPPEDPROCESS_STATE_CHANGE_STARTING_FROM_BACKOFFPROCESS_STATE_CHANGE_STARTING_FROM_EXITEDPROCESS_STATE_CHANGE_STARTING_FROM_FATAL

PROCESS_STATE_RUNNING replacesPROCESS_STATE_CHANGE_RUNNING_FROM_STARTED

PROCESS_STATE_BACKOFF replacesPROCESS_STATE_CHANGE_BACKOFF_FROM_STARTING

PROCESS_STATE_STOPPING replaces:

PROCESS_STATE_CHANGE_STOPPING_FROM_RUNNINGPROCESS_STATE_CHANGE_STOPPING_FROM_STARTING

PROCESS_STATE_EXITED replacesPROCESS_STATE_CHANGE_EXITED_FROM_RUNNING

PROCESS_STATE_STOPPED replacesPROCESS_STATE_CHANGE_STOPPED_FROM_STOPPING

PROCESS_STATE_FATAL replacesPROCESS_STATE_CHANGE_FATAL_FROM_BACKOFF

PROCESS_STATE_UNKNOWN replaces PROCESS_STATE_CHANGE_TO_UNKNOWN

PROCESS_STATE replaces PROCESS_STATE_CHANGE

The PROCESS_STATE_CHANGE_EXITED_OR_STOPPED abstract event is gone.

All process state changes have at least “processname”,“groupname”, and “from_state” (the name of the previous state) intheir serializations.

PROCESS_STATE_EXITED additionally has “expected” (1 or 0) and “pid”(the process id) in its serialization.

PROCESS_STATE_RUNNING, PROCESS_STATE_STOPPING,PROCESS_STATE_STOPPED additionally have “pid” in theirserializations.

PROCESS_STATE_STARTING and PROCESS_STATE_BACKOFF have “tries” intheir serialization (initially “0”, bumped +1 each time a startretry happens).

  • Remove documentation from README.txt, point people tohttp://supervisord.org/manual/ .

  • The eventlistener request/response protocol has changed. OK/FAILmust now be wrapped in a RESULT envelope so we can use it for morespecialized communications.

Previously, to signify success, an event listener would write the stringOK\n to its stdout. To signify that the event was seen but couldn’tbe handled by the listener and should be rebuffered, an event listenerwould write the string FAIL\n to its stdout.

In the new protocol, the listener must write the string:

  1. RESULT {resultlen}\n{result}

For example, to signify OK:

  1. RESULT 2\nOK

To signify FAIL:

  1. RESULT 4\nFAIL

See the scripts/sample_eventlistener.py script for an example.

  • To provide a hook point for custom results returned from eventhandlers (see above) the [eventlistener:x] configuration sectionsnow accept a “resulthandler=” parameter,e.g. “result_handler=supervisor.dispatchers:default_handler” (thedefault) or “handler=mypackage:myhandler”. The keys are pkgutil“entry point” specifications (importable Python function names).Result handlers must be callables which accept two arguments: onenamed “event” which represents the event, and the other named“result”, which represents the listener’s result. A resulthandler either executes successfully or raises an exception. Ifit raises a supervisor.dispatchers.RejectEvent exception, theevent will be rebuffered, and the eventhandler will be placed backinto the ACKNOWLEDGED state. If it raises any other exception,the event handler will be placed in the UNKNOWN state. If it doesnot raise any exception, the event is considered successfullyprocessed. A result handler’s return value is ignored. Writing aresult handler is a “in case of emergency break glass” sort ofthing, it is not something to be used for arbitrary business code.In particular, handlers _must not block for any appreciableamount of time.

The standard eventlistener result handler(supervisor.dispatchers:default_handler) does nothing if it receives an“OK” and will raise a supervisor.dispatchers.RejectEvent exception if itreceives any other value.

  • Supervisord now emits TICK events, which happen every N seconds.Three types of TICK events are available: TICK_5 (every fiveseconds), TICK_60 (every minute), TICK_3600 (every hour). Eventlisteners may subscribe to one of these types of events to performevery-so-often processing. TICK events are subtypes of the EVENTtype.

  • Get rid of OSX platform-specific memory monitor and replace withmemmon.py, which works on both Linux and Mac OS. This script isnow a console script named “memmon”.

  • Allow “web handler” (the handler which receives http requests frombrowsers visiting the web UI of supervisor) to deal with POST requests.

  • RPC interface methods stopProcess(), stopProcessGroup(), andstopAllProcesses() now take an optional “wait” argument that defaultsto True for parity with the start methods.