Skip to content

bug report: supervisord ignores retry limit when startsecs=0 #4708

Description

@polarathene
  • startsecs=0 (default is 1 second) has been used in DMS since supervisord was added into the project back in Aug 2017. It determines how long a service needs to be running before it's moved from the STARTING to RUNNING state.
  • startretries=3 (default) is the number of retry attempts before the service is marked with the status FATAL and is no longer restarted. This only applies during the STARTING status prior to being assigned RUNNING (unless the service fails in this state, where supervisord will restart it, placing it back into STARTING status).

Due to the above mismatch, a service immediately enters RUNNING status, and if it then crashes with an uptime of 0 seconds the startsecs value will immediately switch from STARTING to RUNNING, there is no opportunity to increment the restart counter so it is always reset once the service is marked as RUNNING again.

For a reliable healthcheck script (as is being pursued here), we should correct this.

Known examples of this behaviour observed in DMS:

A side-effect of changing to startsecs = 1 is supervisorctl start (and potentially other sub-commands) are blocking with that delay. Any usage within DMS scripts would be affected by such, most notably during container startup where we sequentially invoke the start command per service individually. In the startup case we should probably collect the services to start and provide them all to a single supervisorctl start ... command, that should keep the impact low. Some container deployments may have a healthcheck policy that kills/restarts the container under an unhealthy state, so let's ensure the downtime is low 😅


Locations for startsecs=0 => startsecs=1 (or deletion):

Refactor invoking supervisorctl start to single use in scripts/startup/daemons-stack.sh:

Either that or a more extensive refactor. This change may also impact the test suite if any test cases are aggressive with timing expectations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/scriptsbug/confirmedA bug report whose bug is confirmedkind/bug/reportA report about a bugmeta/help wantedThe OP requests help from others - chime in! :Dstale-bot/ignoreIndicates that this issue / PR shall not be closed by our stale-checking CI

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions