Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 38fef3770f9aba09bbda9dd5dc929d94b72914e4
Ticket: 1464890fffffffffffffffffffffffffffffffff
after command hangs when system time changes
User & Date: jflarvoire on 2006-04-05 12:37:52
Changes

  1. assignee changed to: "kennykb"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Hello,
    
    I wish to reopen bug #432038, and its duplicate bug
    #1052859:
    
    Changing the system clock hangs all Tcl events handlers
    that are scheduled with the after command.
    This makes it impossible to have reliable periodic
    handlers written in pure Tcl. (They may die
    unexpectedly anytime somebody runs the date/time command)
    
    I've just been badly hurt by this very problem on a
    large cluster we manage: We had system monitoring
    scripts written in Tcl that kept dying mysteriously on
    some of the nodes. And the illness was spreading with
    time...
    
    Contrary to what was written in a comment of bug
    #432038, using NTP does not prevent the problem:
    We saw the problem on machines with harware clocks
    slowly drifting. After each reboot, NTP takes some time
    for resynchronizing the system time... hanging all our
    Tcl scripts timers when it eventually does.
    
    Also I completely disagree with the closing comment in
    bug #1052859 about the lack of monotonically increasing
    timers in both Unix and Windows.
    The Unix sleep command, used in tons of shell scripts,
    is completely immune to such system date/time changes.
    This is easy to verify. Let's use in Tcl's after
    command the same timing function that Unix' sleep does.
    Likewise, Windows' waitable timers are immune too. I
    just verified it with the sample code for
    CreateWaitableTimer in MSDN library.
    
    Jean-François
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "jflarvoire"
  9. subsystem changed to: "03. Timer Events"
  10. title changed to: "after command hangs when system time changes"
  11. type changed to: "Bug"