Bug 1467522

Summary: systemd timer define 1s excute but leak 5s
Product: Red Hat Enterprise Linux 7 Reporter: muahao <muahao>
Component: systemdAssignee: systemd-maint
Status: CLOSED INSUFFICIENT_DATA QA Contact: qe-baseos-daemons
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.2CC: dtardon, jsynacek, msekleta, systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-31 11:58:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description muahao 2017-07-04 06:41:52 UTC
everyone , I define a foo.timer to excute foo.service every seconds

my OS version is centos7u2

    #systemctl --version
    systemd 219
    -PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN

    #systemctl cat  foo.timer
    # /etc/systemd/system/foo.timer
    [Unit]
    Description=Run foo weekly and on boot
    
    [Timer]
    OnBootSec=15min
    OnUnitActiveSec=1s
    AccuracySec=1us
    
    
    [Install]
    WantedBy=timers.target


look what I excute:

    #systemctl cat  foo.service
    # /etc/systemd/system/foo.service
    [Unit]
    Description=test
    
    [Service]
    Type=oneshot
    ExecStart=/usr/lib/aa.sh
    StandardOutput=journal
    StandardError=journal
    
    [Install]
    WantedBy=multi-user.target

script:

    #cat /usr/lib/aa.sh
    #!/bin/sh
    aa=`date`
    echo $aa >> /var/log/aa.log

log file:

    Mon Jul 3 20:28:36 HDT 2017
    Mon Jul 3 20:28:37 HDT 2017
    Mon Jul 3 20:28:38 HDT 2017
    
    Mon Jul 3 20:28:44 HDT 2017
    Mon Jul 3 20:28:45 HDT 2017
    Mon Jul 3 20:28:46 HDT 2017
    Mon Jul 3 20:28:47 HDT 2017
    Mon Jul 3 20:28:48 HDT 2017
    
    
    Mon Jul 3 20:28:54 HDT 2017
    Mon Jul 3 20:28:55 HDT 2017
    Mon Jul 3 20:28:56 HDT 2017
    Mon Jul 3 20:28:57 HDT 2017
    Mon Jul 3 20:28:58 HDT 2017

look this log file ,we can see , I lost 5 seconds contents. I try to OnUnitActiveSec=2s , this problem not appear ,That's why ?

Comment 2 Michal Sekletar 2017-07-04 07:25:53 UTC
Does the issue occur even when you disable start rate limiting for foo.service? Note that to disable ratelimiting you should set in [Service] section following options,

StartLimitBurst=0
StartLimitInterval=0

Comment 3 David Tardon 2019-01-31 11:58:13 UTC
No answer for 1.5 years...