Bug 1467522 - systemd timer define 1s excute but leak 5s
systemd timer define 1s excute but leak 5s
Status: NEW
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd (Show other bugs)
7.2
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: systemd-maint
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-04 02:41 EDT by muahao
Modified: 2017-07-07 04:00 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description muahao 2017-07-04 02:41:52 EDT
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 03:25:53 EDT
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

Note You need to log in before you can comment on or make changes to this bug.