GNU bug report logs - #35400
27.0.50; Timers repeated after waking from suspend

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Stefan Monnier <monnier@HIDDEN>; dated Tue, 23 Apr 2019 17:00:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 35400 <at> debbugs.gnu.org:


Received: (at 35400) by debbugs.gnu.org; 23 Apr 2019 17:30:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 13:30:44 2019
Received: from localhost ([127.0.0.1]:54267 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIzFk-0004yy-Hz
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 13:30:44 -0400
Received: from eggs.gnu.org ([209.51.188.92]:33386)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1hIzFj-0004yn-Hp
 for 35400 <at> debbugs.gnu.org; Tue, 23 Apr 2019 13:30:43 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:38843)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <eliz@HIDDEN>)
 id 1hIzFa-0004Bu-5i; Tue, 23 Apr 2019 13:30:36 -0400
Received: from [176.228.60.248] (port=4411 helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from <eliz@HIDDEN>)
 id 1hIzFU-0004G3-QH; Tue, 23 Apr 2019 13:30:30 -0400
Date: Tue, 23 Apr 2019 20:30:19 +0300
Message-Id: <834l6o4ok4.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-reply-to: <jwvtveowtc1.fsf@HIDDEN> (message from Stefan Monnier
 on Tue, 23 Apr 2019 12:59:42 -0400)
Subject: Re: bug#35400: 27.0.50; Timers repeated after waking from suspend
References: <jwvtveowtc1.fsf@HIDDEN>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 35400
Cc: 35400 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Stefan Monnier <monnier@HIDDEN>
> Date: Tue, 23 Apr 2019 12:59:42 -0400
> 
> now wait a minute and then
> 
>     kill -CONT <emacs-pid>
> 
> and you should see something like:
> 
>     Run at: 12:49:40 [7 times]
> 
> in the *Messages* buffer, before all the repetitions that couldn't be
> run while Emacs was suspended are run when we wake up.
> 
> Apparently this is *not* a new behavior (I can reproduce it with
> Debian's 26.1) although I only recently started noticing it.
> 
> If we decide to consider this a feature (I guess there can be
> circumstances where it might make sense, tho I'm not sure those would
> really work well with the way we handle timers), I think we should
> provide some way for users of timers to indicate whether they want to
> use this feature or not (and I think it makes sense to default to not
> using this feature).

I think you can already control this by customizing the value of
timer-max-repeats.  It is 10 by default, so you should never see more
than 10 repetitions, no matter how long was Emacs suspended.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#35400; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Apr 2019 16:59:55 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 23 12:59:55 2019
Received: from localhost ([127.0.0.1]:54222 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hIylu-0004El-Se
	for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 12:59:55 -0400
Received: from eggs.gnu.org ([209.51.188.92]:42029)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1hIyls-0004EX-Ix
 for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 12:59:53 -0400
Received: from lists.gnu.org ([209.51.188.17]:58990)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <monnier@HIDDEN>)
 id 1hIyln-00068G-75
 for submit <at> debbugs.gnu.org; Tue, 23 Apr 2019 12:59:47 -0400
Received: from eggs.gnu.org ([209.51.188.92]:56382)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <monnier@HIDDEN>) id 1hIylm-0007h7-3I
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2019 12:59:47 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW,
 URIBL_BLOCKED autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <monnier@HIDDEN>) id 1hIyll-000652-32
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2019 12:59:46 -0400
Received: from alt24.smtp-out.videotron.ca ([70.80.0.75]:34380)
 by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
 (Exim 4.71) (envelope-from <monnier@HIDDEN>)
 id 1hIylk-000632-SY
 for bug-gnu-emacs@HIDDEN; Tue, 23 Apr 2019 12:59:44 -0400
Received: from fmsmemgm.homelinux.net ([24.203.163.157]) by Videotron with SMTP
 id Iylihzs1RHTT3IyljhWyX9; Tue, 23 Apr 2019 12:59:44 -0400
X-Authority-Analysis: v=2.3 cv=ZegzyPdA c=1 sm=1 tr=0
 a=271BjrAMcq2W4n6OKK/JJg==:117 a=271BjrAMcq2W4n6OKK/JJg==:17
 a=oexKYjalfGEA:10 a=aR16PxjQAAAA:8 a=RB2lgiZKs_l3Kn8TLNgA:9
 a=zbFvvTOBjyH4ze5LlUjX:22
Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848)
 id B0A13AE1E3; Tue, 23 Apr 2019 12:59:42 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 27.0.50; Timers repeated after waking from suspend
Date: Tue, 23 Apr 2019 12:59:42 -0400
Message-ID: <jwvtveowtc1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-CMAE-Envelope: MS4wfJGRgS4IbwoLWABKl33iYeZSzs16Ear0UrPGvMxx6DpbbUFenWaJEfu+LAGkMpDJ4PaQQKJl73PYHmESZLKDtO+GA0MQDZueIJ+h/W9nvDcB1fIA6OaS
 5SewftEZzSvxRNJJJpUcCC2Z+WlDg/07zbFwV6Cis6WXtYaRu00HpHCNP5bEhcbQA/Meu6nM+CiTqg==
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 70.80.0.75
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Package: Emacs
Version: 27.0.50


If Emacs is prevented from running for a "long" time (via the `STOP`
signal, C-z, suspend-to-ram, thrashing, you name it), the "missed"
repetitions of timer events all get run when we wake up.

E.g. you can try the following:

    % emacs -Q
    (run-with-timer 5 5 (lambda () (message "Run at: %s" (format-time-string "%H:%M:%S"))))
    C-j
    C-x b *Messages* RET
    
you should see a message emitted every 5 seconds.  Then do:

    kill -STOP <emacs-pid>
    
now wait a minute and then

    kill -CONT <emacs-pid>

and you should see something like:

    Run at: 12:49:40 [7 times]

in the *Messages* buffer, before all the repetitions that couldn't be
run while Emacs was suspended are run when we wake up.

Apparently this is *not* a new behavior (I can reproduce it with
Debian's 26.1) although I only recently started noticing it.

If we decide to consider this a feature (I guess there can be
circumstances where it might make sense, tho I'm not sure those would
really work well with the way we handle timers), I think we should
provide some way for users of timers to indicate whether they want to
use this feature or not (and I think it makes sense to default to not
using this feature).


        Stefan



In GNU Emacs 27.0.50 (build 1, x86_64-unknown-linux-gnu, GTK+ Version 3.24.5)
 of 2019-04-14 built on alfajor
Repository revision: bd7668ee53b3597ee229afd83e18b6cdb6315056
Repository branch: work
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Debian GNU/Linux buster/sid

Recent messages:
Mark set
Mark activated
Mark set
Auto-saving...done
Saving file /home/monnier/src/emacs/elpa/packages/smalltalk-mode/smalltalk-mode.el...
Wrote /home/monnier/src/emacs/elpa/packages/smalltalk-mode/smalltalk-mode.el
Saving file /home/monnier/share/etc/diary...
Wrote /home/monnier/share/etc/diary
Marking diary entries...done
(New file)




Acknowledgement sent to Stefan Monnier <monnier@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#35400; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.