Open XA21X opened 6 years ago
Or it might be easier to just special-case PID1? :P
I believe this could happen if the preview generator crashes or is interrupted while executing php occ directly (via docker run/exec).
Agreed, this could happen under some circumstances:
Or it might be easier to just special-case PID1? :P
True, it is probably most likely to happen with 1
. Tempting! :)
Maybe also with Docker environments with their own PID namespaces?
If this is the case, some time-based check might still be valuable in addition to the pid check - that is, periodically update a watchdog timestamp in the appconfig and treat the previous instance as dead if it hasn't been updated for a while?
Maybe. Or just check for the other matching running processes (that look like other copies of us) outright and error out as already running in that case.
Related: #328
That is weird. Running exec should not start the command with PID 1 inside the running container.
But yeah, having a command to reset the pid lock or a fail-safe is probably a good idea.
In the meantime, the log can be reset by running the following raw SQL query:
DELETE FROM
oc_appconfig
WHERE
appid = 'previewgenerator'
AND configkey = 'pid';
Since #93, I don't believe
pid
is ever reset as a fail-safe?Logs indicated that
pre-generate
was always returningcommand is already running
so I was getting suspicious. I finally checked theappconfig
and noticed thatpid == 1
, which will never not be running.I believe this could happen if the preview generator crashes or is interrupted while executing
php occ
directly (viadocker run/exec
). If this is the case, some time-based check might still be valuable in addition to thepid
check - that is, periodically update a watchdog timestamp in theappconfig
and treat the previous instance as dead if it hasn't been updated for a while?