fetchmail-friends
[Top] [All Lists]

[fetchmail]laptop suspend and the poll interval

2002-05-21 10:42:38
I set my poll interval to 600 (10 minutes) and run fetchmail in daemon mode
on my laptop.  Now, suppose fetchmail checks for my mail, and I suspend 1
minute later.  If I resume a half hour later, I would expect fetchmail to
repoll immediately.  Instead, I must wait another 9 minutes.

Now, one might say "That's the behaviour of select(), which we use to sleep
for 600 seconds."  But it isn't.  If I run strace on the running fetchmail
process, I see something like this:

select(0, NULL, NULL, NULL, {406, 790000} <unfinished ...>

Which implies that select() returned after about 196secs, and fetchmail put
itself back to sleep for 406secs in order to finish its 600 second poll
interval.  I think fetchmail should call gettimeofday, notice that more
time than expected has passed, and act accordingly.


Of course there is a downside to all of this.  If fetchmail *did* poll
immediately, I suspect it would usually fail, as my laptop has to
reestablish itself (possibly at a new location) with DHCP.  So maybe it
should always wait at least 30 seconds or something like that.

In the end, maybe I should be happy about the current behaviour and not ask
for my something that seems a bit hackish.  I'm interested in what other
people thing is the right thing to do though.

  jj


<Prev in Thread] Current Thread [Next in Thread>
  • [fetchmail]laptop suspend and the poll interval, John Jannotti <=