all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Gijs Hillenius" <gijs@hillenius.net>
Cc: 39824@debbugs.gnu.org
Subject: bug#39824: 26.2; timers sometimes stop working when coming back from sleep
Date: Fri, 03 Apr 2020 15:35:48 +0300	[thread overview]
Message-ID: <83imigwxuj.fsf@gnu.org> (raw)
In-Reply-To: <87lfnf4r80.fsf@hillenius.net> (message from Gijs Hillenius on Wed, 01 Apr 2020 09:09:35 +0200)

> From: Gijs Hillenius <gijs@hillenius.net>
> Cc: 39824@debbugs.gnu.org
> Date: Wed, 01 Apr 2020 09:09:35 +0200
> 
> I need a bit of help with instrumenting this correctly:

See below for some ideas.

> I've instrumented (run-at-time "10:35" 21600 'org-mobile-push)
> 
> using (evel-defun) C-M-x
> 
> This shows org-mobile-push runs without errors. In *Messages*:
> 
> (snip)
> Edebug: edebug-anon11
> Tracing...
> Result: [nil 24189 51396 0 21600 org-mobile-push nil nil 0]

This time corresponds to 2020-03-27 10:35:00.  Did you show the timer
before or after the call to timer-inc-time in timer-event-handler,
which calls your timer function?  If this is after timer-inc-time was
called, then the above is the time of the _next_ timer invocation.  I
think it would be useful to log in *Messages* also the value of
current-time when the timer runs.

> Creating agendas...
> Preparing diary...done
> 
> [...] ten lines equal to this ^ one
> 
> Preparing diary...done
> Agenda written to Org file /home/gijs/d/MobileOrg/agendas.org
> Creating agendas...done
> Saving all Org buffers... done
> Copying files...
> Writing index file...
> Writing checksums...
> Files for mobile viewer staged
> [nil 24190 7460 0 21600 org-mobile-push nil nil 0]

This time corresponds to 2020-03-27 16:35:00, the next time your timer
should fire.

> M-x list-timers tells me:
> 
>       -71245.81   360.00 org-mobile-push
> 
> and eh, a little later, the variable value of list-timers shows:
> 
> ([t 24188 52132 0 21600 org-mobile-push nil nil 0]

But this time corresponds to 2020-03-26 16:35:00, i.e. the _previous_
day.  How could this have happened?

> But then...  I guess (eval-defun) has run. I was expecting it to run
> again in six hours?  I can wait all day, put the laptop to sleep, but
> the timer won't repeat. The next day the list-timer will show a minus
> sign for org-mobile-push, for example
> 
> -54728.53   360.00 org-mobile-push
> 
> and looking at /home/gijs/d/MobileOrg/agendas.org will show me the files
> were updated only when I eval-defun'ed (run-at-time "10:35" 21600
> 'org-mobile-push) the day before. Not at 10:35, not "six hours" later,
> not the next morning.

So you are saying that the messages in *Messages* that report the
update of /home/gijs/d/MobileOrg/agendas.org on 2020-03-27 10:35:00
are a lie, and no update actually happened at that time?  That would
be surprising, since Emacs says it wrote the file.  Or am I missing
something?  Maybe the time value shown there is the time of the _next_
timer trigger?

> Did I evel-defun'ed org-mobile-push, instead of run-at-time?

I cannot know that.  But what I had in mind was to add 'message' calls
in timer-event-handler, where it calls the timer function, increments
the time to calculate the next time the timer should run, and sets the
first element of the timer vector to nil.  Then we might have a better
idea what happens there when this strange problem occurs.  In
particular, I now wonder how come timer-inc-time returned the time for
the _previous_ day (assuming it was that function which did it).

Thanks.





  reply	other threads:[~2020-04-03 12:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 15:52 bug#39824: 26.2; timers sometimes stop working when coming back from sleep ndame
2020-03-01 19:31 ` Eli Zaretskii
2020-03-02  5:22   ` ndame
2020-03-02  5:29     ` ndame
2020-03-06  9:14     ` Eli Zaretskii
2020-03-06 16:30       ` ndame
2020-03-06 17:07         ` Eli Zaretskii
2020-03-21  9:23           ` Gijs Hillenius
2020-03-24  8:27       ` Gijs Hillenius
2020-03-25 14:37         ` Eli Zaretskii
2020-03-25 14:55           ` Gijs Hillenius
2020-04-01  7:09           ` Gijs Hillenius
2020-04-03 12:35             ` Eli Zaretskii [this message]
2020-04-08 14:54           ` bug#39824: I can't reproduce this any longer (was: bug#39824: 26.2; timers sometimes stop working when coming back from sleep) Gijs Hillenius
2020-04-08 15:11             ` Eli Zaretskii
2020-04-19 13:28 ` bug#39824: 26.2; timers sometimes stop working when coming back from sleep ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-04-19 13:59 ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-04-19 15:28   ` Eli Zaretskii
2020-04-19 15:54     ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-04-19 16:46       ` Eli Zaretskii
2020-04-19 17:34         ` ndame via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-04-19 18:53           ` Eli Zaretskii
     [not found]             ` <CADwFkm=i7zz8xjw=RcbFg7evQqBFpMY5phHEJnfQk+n75Y2LRg@mail.gmail.com>
2020-08-23 12:58               ` Eli Zaretskii
2020-08-23 13:36                 ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83imigwxuj.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=39824@debbugs.gnu.org \
    --cc=gijs@hillenius.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.