shutdown from within Drizzle panics on assertion - upstart respawn consequences
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Confirmed
|
Medium
|
Unassigned | ||
drizzle (Ubuntu) |
Confirmed
|
Medium
|
Unassigned |
Bug Description
This seems to be specific to running drizzled under upstart, ie modern Ubuntu versions. It happens as installed with the debs that come with Ubuntu and also the basis for our future own deb downloads. I don't know if this is an error in our upstart script, or upstart itself. In particular, should upstart with a respawn directive allow the service to shutdown when it exits without error?
The symptom is that "shutdown" given via the client is ineffective / becomes a restart.
hingo@mermaid:
root 19723 0.0 0.0 2040 508 ? Ss 23:33 0:00 /bin/sh -e -c exec /usr/sbin/drizzled --user drizzle 2>&1 | logger -t drizzle -p daemon.err /bin/sh
drizzle 19724 0.6 1.9 395252 39592 ? Sl 23:33 0:00 /usr/sbin/drizzled --user drizzle
root 19725 0.0 0.0 1952 540 ? S 23:33 0:00 logger -t drizzle -p daemon.err
hingo 19749 0.0 0.0 5656 800 pts/0 S+ 23:33 0:00 grep drizzle
hingo@mermaid:
hingo@mermaid:
root 19752 0.0 0.0 2040 512 ? Ss 23:33 0:00 /bin/sh -e -c exec /usr/sbin/drizzled --user drizzle 2>&1 | logger -t drizzle -p daemon.err /bin/sh
drizzle 19753 10.0 1.9 387056 38948 ? Sl 23:33 0:00 /usr/sbin/drizzled --user drizzle
root 19754 0.0 0.0 1952 544 ? S 23:33 0:00 logger -t drizzle -p daemon.err
hingo 19776 0.0 0.0 5656 796 pts/0 S+ 23:33 0:00 grep drizzle
hingo@mermaid:
drizzle stop/waiting
hingo@mermaid:
hingo 19836 0.0 0.0 5656 800 pts/0 S+ 23:40 0:00 grep drizzle
hingo@mermaid:
The standard way "service drizzle stop" works.
Changed in drizzle: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in drizzle: | |
status: | Invalid → Confirmed |
Excerpts from Henrik Ingo's message of Sun Jan 22 21:43:11 UTC 2012: ~/hacking/ drizzle/ deb$ ps aux|grep drizzle ~/hacking/ drizzle/ deb$ drizzle --execute= "shutdown" ~/hacking/ drizzle/ deb$ ps aux|grep drizzle ~/hacking/ drizzle/ deb$ sudo service drizzle stop ~/hacking/ drizzle/ deb$ ps aux|grep drizzle ~/hacking/ drizzle/ deb$
> Public bug reported:
>
> This seems to be specific to running drizzled under upstart, ie modern
> Ubuntu versions. It happens as installed with the debs that come with
> Ubuntu and also the basis for our future own deb downloads. I don't know
> if this is an error in our upstart script, or upstart itself. In
> particular, should upstart with a respawn directive allow the service to
> shutdown when it exits without error?
>
> The symptom is that "shutdown" given via the client is ineffective /
> becomes a restart.
>
>
> hingo@mermaid:
> root 19723 0.0 0.0 2040 508 ? Ss 23:33 0:00 /bin/sh -e -c exec /usr/sbin/drizzled --user drizzle 2>&1 | logger -t drizzle -p daemon.err /bin/sh
> drizzle 19724 0.6 1.9 395252 39592 ? Sl 23:33 0:00 /usr/sbin/drizzled --user drizzle
> root 19725 0.0 0.0 1952 540 ? S 23:33 0:00 logger -t drizzle -p daemon.err
> hingo 19749 0.0 0.0 5656 800 pts/0 S+ 23:33 0:00 grep drizzle
> hingo@mermaid:
> hingo@mermaid:
> root 19752 0.0 0.0 2040 512 ? Ss 23:33 0:00 /bin/sh -e -c exec /usr/sbin/drizzled --user drizzle 2>&1 | logger -t drizzle -p daemon.err /bin/sh
> drizzle 19753 10.0 1.9 387056 38948 ? Sl 23:33 0:00 /usr/sbin/drizzled --user drizzle
> root 19754 0.0 0.0 1952 544 ? S 23:33 0:00 logger -t drizzle -p daemon.err
> hingo 19776 0.0 0.0 5656 796 pts/0 S+ 23:33 0:00 grep drizzle
> hingo@mermaid:
> drizzle stop/waiting
> hingo@mermaid:
> hingo 19836 0.0 0.0 5656 800 pts/0 S+ 23:40 0:00 grep drizzle
> hingo@mermaid:
>
Hi Henrik, this makes sense.
We need to define 0 as a normal exit code for drizzle.
man 5 init states that using respawn on a job will cause upstart to respawn
the process unless you change the "goal" of the job to 'stop'. However, you
can also define a normal exit code that will allow the job to transition to
stop.
From man 5 init:
respawn
A service or task with this stanza will be automatically started
if it should stop abnormally. All reasons for a service stopping,
except the stop(8) command itself, are considered abnormal.
Tasks may exit with a zero exit status to prevent being respawned.
respawn limit COUNT INTERVAL
Respawning is subject to a limit, if the job is respawned more
than COUNT times in INTERVAL seconds, it will be considered to be
hav‐ ing deeper problems and will be stopped. Default COUNT is
10. Default INTERVAL is 5 seconds.
This only applies to automatic respawns and not the restart(8)
command.
normal exit STATUS|SIGNAL...
Additional exit statuses or even signals may be added, if the
job process terminates with any of these it will not be considered
to have failed and will not be respawned.
normal exit 0 1 TERM HUP