Skip to content
Snippets Groups Projects
  1. Jan 21, 2013
    • Iustin Pop's avatar
      Change the polling thread sleep behaviour · 01eea342
      Iustin Pop authored
      
      Currently, the polling thread sleeps at the end of its body; the
      original reason was that when the thread initially starts, we want to
      load the config immediately (in the old-style config load model).
      
      However, now we explicitly load the config, so we can make this thread
      behave like the watcher thread: sleep first, then do the work. This
      model improves for example the startup of the thread, by not redoing a
      config check immediately after switching to polling mode.
      
      We also increase the max idle poll rounds interval from 2 to 3; the
      new behaviour means that we revert from polling to inotify after
      around one second of no changes.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      01eea342
    • Iustin Pop's avatar
      First part of confd timer changes · 7e7fa841
      Iustin Pop authored
      
      This patch changes the resolution of the timers: the watcher timer
      goes from 60s to 17s, and the polling-mode timer goes from 2 seconds
      to 250ms. The code changes a bit more due to the changes in the units
      of the various constants.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      7e7fa841
    • Iustin Pop's avatar
      Increase Haskell log file resolution · ce817701
      Iustin Pop authored
      
      Currently the Haskell logging goes with the default time formatting,
      which lacks sub-second resolution. This is not good, as it's too
      coarse.
      
      The patch adds picoseconds to the log; they will contain usually too
      many zeroes, but the other option is to use a log format that (for
      precisely zero fractional part) omits the separator, so it's not
      consistent from line to line, and which also uses a dot as a
      separator, different from the Python code.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      ce817701
    • Iustin Pop's avatar
      Add a function to get the current time in microseconds · a6e054a8
      Iustin Pop authored
      
      In some cases we need higher resolution that seconds; I've settled on
      microseconds as that is what 'threadDelay' wants, for exactly, so it's
      easier if we keep the same units.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichele Tartara <mtartara@google.com>
      a6e054a8
    • Iustin Pop's avatar
      Start confd in notify mode if we can · c62df702
      Iustin Pop authored
      
      This patch changes the default model—where confd is always started in
      polling mode—to a model where if possible we enable inotify mode
      before starting any of the background threads.
      
      There are some tricky details here: if we enable inotify, we should
      not modify the server state after wards, as inotify events could have
      already fired and took ownership; therefore we presume that inotify
      will work and set reloadModel=ReloadNotify, and only if we fail to
      enable it we change it back to polling mode.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      c62df702
    • Iustin Pop's avatar
      Explicitly load the config at confd startup · 3190ad64
      Iustin Pop authored
      
      Currently, confd main function doesn't load the config, but simply
      forks the individual timer threads, which will—as a side effect-also
      load the configuration as soon as they start.
      
      However, this makes codes to the startup more complex, so let's
      explicitly (try to) load the configuration as first thing.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      3190ad64
  2. Jan 18, 2013
  3. Jan 17, 2013
  4. Jan 16, 2013
Loading