Bug#1052053: popularity-contest: race condition between the two cron jobs
Package: popularity-contest
Version: 1.77
Severity: normal
Hi,
I have been unlucky and the two instance of the cronjob
triggered at the same time, stepping on eachother feets.
(at the "savelog -c 7 popularity-contest >/dev/null" step precisely)
Can you implement some locking ?
Or alternatively #923014 will get you locking for free
on systemd running systems.
Greetings,
> PS: the error handling is well lacking in 'savelog':
>
> # compress the old uncompressed log if needed
> if test -n "$datum" && test -n "$COMPRESS"; then
> $COMPRESS $COMPRESS_OPTS -- "$newname".[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
> fi
root@antec:~# journalctl | grep popul | grep service
sep 16 17:02:28 antec systemd[1]: Starting cron-daily-popularity-contest.service
- [Cron] /etc/cron.daily/popularity-contest...
sep 16 17:02:28 antec systemd[1]: Starting cron-popularity-contest-root-d2f25b2334da37b6f3ef98c2dc14fad3.service
- [Cron] "56 18 * * * root test -x /etc/cron.daily/popularity-contest && /etc/cron.daily/popularity-contest --crond"...
○ cron-daily-popularity-contest.service - [Cron] /etc/cron.daily/popularity-contest
Loaded: loaded (/etc/cron.daily/popularity-contest; generated)
Active: inactive (dead) since Sat 2023-09-16 17:05:50 CEST; 95ms ago
TriggeredBy: ● cron-daily-popularity-contest.timer
Process: 793 ExecStart=/etc/cron.daily/popularity-contest (code=exited, status=0/SUCCESS)
Main PID: 793 (code=exited, status=0/SUCCESS)
CPU: 9.798s
2023-09-16T17:02:28+0200 antec systemd[1]: Starting cron-daily-popularity-contest.service - [Cron] /etc/cron.daily/popularity-contest...
2023-09-16T17:02:28+0200 antec popularity-contest[881]: gzip: .//popularity-contest.0: No such file or directory
2023-09-16T17:02:28+0200 antec popularity-contest[892]: mv: impossible d'évaluer './/popularity-contest.0.gz': Aucun fichier ou dossier de ce type
2023-09-16T17:02:28+0200 antec popularity-contest[897]: mv: impossible d'évaluer 'popularity-contest': Aucun fichier ou dossier de ce type
2023-09-16T17:05:50+0200 antec systemd[1]: cron-daily-popularity-contest.service: Deactivated successfully.
2023-09-16T17:05:50+0200 antec systemd[1]: Finished cron-daily-popularity-contest.service - [Cron] /etc/cron.daily/popularity-contest.
2023-09-16T17:05:50+0200 antec systemd[1]: cron-daily-popularity-contest.service: Consumed 9.798s CPU time.
-- System Information:
Debian Release: trixie/sid
APT prefers testing
APT policy: (501, 'testing'), (450, 'unstable'), (400, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 6.4.0-4-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=fr_BE.UTF-8, LC_CTYPE=fr_BE.UTF-8 (charmap=UTF-8), LANGUAGE=fr_BE:fr
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages popularity-contest depends on:
ii debconf [debconf-2.0] 1.5.82
ii dpkg 1.22.0
Versions of packages popularity-contest recommends:
ii gpg 2.2.40-1.1
ii nullmailer [mail-transport-agent] 1:2.2+10~g7ed88a0-1
ii systemd-cron [cron-daemon] 2.1.3-1
Versions of packages popularity-contest suggests:
ii systemd-cron [anacron] 2.1.3-1
pn tor <none>
pn torsocks <none>
-- debconf information:
* popularity-contest/participate: true
popularity-contest/submiturls:
Reply to: