Skip to content
Tcl Source Code History Of Ticket 3541646fffffffff
Login

History Of Ticket 3541646fffffffff

Artifacts Associated With Ticket 3541646fffffffff

  1. Ticket change [bf5d7c9065] (rid 102242) by ferrieux on 2012-07-09 16:12:37:

    1. assignee initialized to: "nijtmans"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      As detected by Vikki on thread
      
      https://groups.google.com/group/comp.lang.tcl/tree/browse_frm/thread/b08745216b7b4932/cca074d98284b134?hl=en&rnum=1&_done=%2Fgroup%2Fcomp.lang.tcl%2Fbrowse_frm%2Fthread%2Fb08745216b7b4932%2Fd0d28843efbd42a7%3Fhl%3Den%26#doc_cca074d98284b134
      
      when a write on the notifier's triggerPipe returns EAGAIN (because the stream of notifier configuration updates is too fast for the thread to drain the pipe), we now panic, starting from this commit:
      
      File unix/tclUnixNotfy.c
      2009-12-16 23:25:59 - part of checkin [e52afe7fa4] on branch trunk - Fix gcc warning: ignoring return value of ‘write’, declared with attribute warn_unused_result CONSTify functions TclpGetUserHome and TclSetPreInitScript (TIP #27) (user: nijtmans ) [annotate]
      
      This too heavy handed. As explained in the above thread, in this situation the notifier will be constantly woken up, so losing one of these "wake-ups" is not an issue (one wake up can serve several updates).
      
      Note that this only applies to the \0 signal (wake-up).
      For the 'q' signal (for notifier finalization), things are trickier:
         - blocking mode is still out of the question since we're holding the notifierMutex. In this situation it would lead to a deadlock.
         - losing the 'q' is problematic since we'd never end the finalization
      So I would advise a switch to a lockless scheme for the 'q' (which is okay since it is a monotonic flag).
      
      Assigning to Jan as author of the offending commit ;-)
      
      
      
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "7 High"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "ferrieux"
    10. subsystem initialized to: "01. Notifier"
    11. title initialized to: "Don't panic on triggerPipe overrun"
    12. type initialized to: "Bug"
  2. Ticket change [65e1263461] (rid 102615) by nijtmans on 2012-07-11 01:34:03:

    1. icomment:
      Should be fixed now in core-8-5-branch. trunk still to be done.
      
      The real problem (the notifyer losing wake-ups) is still
      not fixed, but this should at least be enough to make
      the described bug disappear in the upcoming 8.5.12.
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  3. Ticket change [33526e5c4e] (rid 106571) by nijtmans on 2012-07-11 01:34:04:

    1. resolution changed to: "Fixed"
  4. Ticket change [8e09b38534] (rid 120048) by ferrieux on 2012-07-11 05:32:45:

    1. icomment:
      No, the notifier is not losing wake-ups when the pipe is full !
      
      The purpose of the \0 send over the triggerPipe is to kick the notifier out of the current select(), recompute the select masks according to the new state of all fileevents in all threads, and back to blocking select() with the new state.
      Hence, a single \0 can serve many updates. When the pipe is full of 4096 wake-ups, the 4097th is a waste anyway.
      
      As mentioned earlier, only the 'q' is problematic. My suggestion for this is to replace the 'q' with simply setting a global flag pleaseNotifierDie, and sending a regular \0 over the pipe, with the same waking effect. The flag, checked in the loop at the same place where the 'q' is sought, would break out of the loop and terminate the notifier. In the context of the original poster, this would even yield a faster exit since this would bypass the 4096 enqueued (useless) updates.
      
      Comments ?
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. username: "ferrieux"
  5. Ticket change [9ae4bacddc] (rid 111026) by nijtmans on 2012-07-11 13:05:02:

    1. assignee changed to: "ferrieux"
    2. foundin changed to: "obsolete: 8.6b2"
    3. icomment:
      >Comments ?
      I think your suggestions are good. But the title of this issue
      is about panicing when it shouldn't, well it doesn't any
      more now in the described situation. ;-)
      
      What I would like very much is a test-case, showing
      the problem. I know the current nofitier has
      problems, but it's difficult to tackle that
      without a test-case. Since 8.6 is
      multi-threaded by default, I only
      would make such further changes
      in 8.6, and possibly backport
      only afther they proved theyr
      effect. By any means: feel
      free to do that! Apparently
      you experimented more with
      the notifier than I did.
      
      Thanks!
               Jan Nijtmans
      
      
    4. login: "nijtmans"
    5. mimetype: "text/plain"
    6. username: "nijtmans"
  6. Ticket change [9461421a03] (rid 105968) by nijtmans on 2012-07-11 13:08:03:

    1. icomment:
      Forgot to mention: merged to trunk now as well.
      
      
    2. login: "nijtmans"
    3. mimetype: "text/plain"
    4. username: "nijtmans"
  7. Ticket change [ae349ea17b] (rid 101602) by nijtmans on 2012-07-11 13:08:04:

    1. closedate changed to: "2012-07-11T06:08:04"
    2. closer changed to: "nijtmans"
    3. status changed to: "Pending"
  8. Ticket change [ecb6cb8a3a] (rid 103756) by rmax on 2012-07-11 16:21:52:

    1. icomment:
      FWIW, the pipe(7) manpage on Linux says that from version 2.6.11 the capacity of a pipe is 64kBytes and before it was identical to the page size, e.g. 4096 on i386.
      
      
    2. login: "rmax"
    3. mimetype: "text/plain"
    4. username: "rmax"
  9. Ticket change [d531d32324] (rid 134178) by dkf on 2013-09-24 12:09:06:

    1. closedate changed to: "2456560.00632497"
    2. closer changed to: "dkf"
    3. comment changed to:
      As detected by Vikki on thread
      
      https://groups.google.com/group/comp.lang.tcl/tree/browse_frm/thread/b08745216b7b4932/cca074d98284b134?hl=en&rnum=1&_done=%2Fgroup%2Fcomp.lang.tcl%2Fbrowse_frm%2Fthread%2Fb08745216b7b4932%2Fd0d28843efbd42a7%3Fhl%3Den%26#doc_cca074d98284b134
      
      when a write on the notifier's triggerPipe returns EAGAIN (because the stream of notifier configuration updates is too fast for the thread to drain the pipe), we now panic, starting from this commit:
      
      File unix/tclUnixNotfy.c
      2009-12-16 23:25:59 - part of checkin [e52afe7fa4] on branch trunk - Fix gcc warning: ignoring return value of ‘write’, declared with attribute warn_unused_result CONSTify functions TclpGetUserHome and TclSetPreInitScript (TIP #27) (user: nijtmans ) [annotate]
      
      This too heavy handed. As explained in the above thread, in this situation the notifier will be constantly woken up, so losing one of these "wake-ups" is not an issue (one wake up can serve several updates).
      
      Note that this only applies to the \0 signal (wake-up).
      For the 'q' signal (for notifier finalization), things are trickier:
         - blocking mode is still out of the question since we're holding the notifierMutex. In this situation it would lead to a deadlock.
         - losing the 'q' is problematic since we'd never end the finalization
      So I would advise a switch to a lockless scheme for the 'q' (which is okay since it is a monotonic flag).
      
      Assigning to Jan as author of the offending commit ;-)
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. severity changed to: "Critical"
    7. status changed to: "Closed"