Code review comment for lp:~vila/udd/735477-kill-harder

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 3/18/2011 5:56 PM, Vincent Ladeuil wrote:
> As a data point, in mass-import-in-etc we do:
>
> restart)
> echo -n "Restarting $NAME"
> d_stop
> sleep 1
> d_start
> echo "."
> ;;
>
> d_stop being:
>
> d_stop() {
> start-stop-daemon --stop --pidfile $PIDFILE --exec /usr/bin/python
> }
>
> which by default send a SIGTERM.
>
> So we wait 1 second for the mass_import.py to shut down before starting it again.
>
> 'graceful_stop' now is a different beast but that;s not what this proposal is about.

Wouldn't it make more sense to actually wait for the pid to disappear?
Note, though, if it is something that is listening on a socket, etc. You
often don't have to wait for it to die completely before restarting, as
long as it won't try to respond to new requests.

I don't think mass_import follows that specific logic, but as long as it
won't try to start new imports, you can bring up the next process, even
if this one isn't dead yet.

I wonder how scripts like apache's start/stop/restart logic work, since
they certainly don't just sleep expecting the service to stop in that time.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2EaeQACgkQJdeBCYSNAAO31wCgnV3zGPbZfQ+adwyDTUPtv7JY
jeQAoMtB2zL7sD7xnfUk5+y53codEAAE
=zlRY
-----END PGP SIGNATURE-----

« Back to merge proposal