[php-maint] Bug#711291: Bug#711291: php5 cron file can run multiple times in parallel

Alexander E. Patrakov patrakov at gmail.com
Thu Jun 6 09:38:24 UTC 2013

2013/6/6 Ondřej Surý <ondrej at debian.org>:
> Control: fixed -1 php5/5.5.0~alpha1-1
> Control: tags -1 wheezy
> Hi Alexander,
> you might want to pull cron job:
> http://anonscm.debian.org/gitweb/?p=pkg-php/php.git;a=blob;f=debian/php5-common.php5.cron.d;h=8865fddb4c451f38f0d6f1ae722a3082c2eb5f81;hb=refs/heads/debian-experimental
> and sessionclean script:
> http://anonscm.debian.org/gitweb/?p=pkg-php/php.git;a=blob;f=debian/sessionclean;h=a5f5360d015a4e74199f8c71152ab96f0bd4bb33;hb=refs/heads/debian-experimental
> I have already improved the session clean script, but it didn't make it into
> wheezy, because of lack of testers with too many session files.
> Unfortunatelly we cannot avoid looking at the files, because of #626640.

I see. The new script does avoid a per-session-file process call, and
that should be much better than the current situation. However, I (as
a person who reviews your code) disagree that the bug has been fixed
completely, because it is still possible that two instances of
sessionclean run in parallel from cron and thus uselessly raise the
load average. Please use a lock file (e.g. with flock -w 0
/run/lock/php5.lck prepended to the original sessionclean invocation)
to avoid that issue. As a bonus, this will generate a cron mail
(without raising LA) if the script does run over its own tail.

Alexander E. Patrakov

More information about the pkg-php-maint mailing list