From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#35400: 27.0.50; Timers repeated after waking from suspend Date: Tue, 23 Apr 2019 12:59:42 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="238185"; mail-complaints-to="usenet@blaine.gmane.org" To: 35400@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 23 19:00:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hIymC-000znz-Dx for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Apr 2019 19:00:12 +0200 Original-Received: from localhost ([127.0.0.1]:56804 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIymB-0007m4-Ej for geb-bug-gnu-emacs@m.gmane.org; Tue, 23 Apr 2019 13:00:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIym5-0007lj-I6 for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2019 13:00:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIym4-0006cg-Bh for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2019 13:00:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40678) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIym4-0006cN-7n for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2019 13:00:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hIym3-0004Fe-Uz for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2019 13:00:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Apr 2019 17:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35400 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.155603879516295 (code B ref -1); Tue, 23 Apr 2019 17:00:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Apr 2019 16:59:55 +0000 Original-Received: from localhost ([127.0.0.1]:54222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIylu-0004El-Se for submit@debbugs.gnu.org; Tue, 23 Apr 2019 12:59:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42029) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hIyls-0004EX-Ix for submit@debbugs.gnu.org; Tue, 23 Apr 2019 12:59:53 -0400 Original-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 ) id 1hIyln-00068G-75 for submit@debbugs.gnu.org; Tue, 23 Apr 2019 12:59:47 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIylm-0007h7-3I for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2019 12:59:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIyll-000652-32 for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2019 12:59:46 -0400 Original-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 ) id 1hIylk-000632-SY for bug-gnu-emacs@gnu.org; Tue, 23 Apr 2019 12:59:44 -0400 Original-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 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id B0A13AE1E3; Tue, 23 Apr 2019 12:59:42 -0400 (EDT) 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-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158151 Archived-At: 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 now wait a minute and then kill -CONT 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)