Skip to content
Snippets Groups Projects
  1. Oct 06, 2008
    • Iustin Pop's avatar
      Add a simple timespec parsing function · 2241e2b9
      Iustin Pop authored
      This function will be used for auto-archiving jobs via the command line.
      The function is pretty simple, we only support up to weeks since months
      and higher are not 'precise' entities, and dealing with them would
      require us to start using calendar functions.
      
      Reviewed-by: imsnah
      2241e2b9
  2. Oct 01, 2008
  3. Sep 11, 2008
    • Guido Trotter's avatar
      LockSet: forbid add() on a partially owned set · d2aff862
      Guido Trotter authored
      This patch bans add() on a half-acquired set. This behavior was
      previously possible, but created a deadlock if someone tried to acquire
      the set-lock in the meantime, and thus is now forbidden. The
      testAddRemove unit test is fixed for this new behavior, and includes a
      few more lines of testing and a new testConcurrentSetLockAdd function
      tests its behavior in the concurrent case.
      
      Reviewed-by: imsnah
      d2aff862
    • Guido Trotter's avatar
      Fix LockSet._names() to work with the set-lock · d4803c24
      Guido Trotter authored
      If the set-lock is acquired, currently, the _names function will fail on
      a double acquire of a non-recursive lock. This patch fixes the behavior,
      and some lines of code added to the testAcquireSetLock test check that
      this and other functioins behave properly.
      
      Reviewed-by: imsnah
      d4803c24
  4. Sep 05, 2008
  5. Aug 29, 2008
  6. Aug 18, 2008
    • Guido Trotter's avatar
      A few more locking unit tests · d4f6a91c
      Guido Trotter authored
      A few more tests written while bug-hunting. One of them shows a real
      issue, at last. :)
      
      Reviewed-by: imsnah
      d4f6a91c
    • Guido Trotter's avatar
      Add lock-all-through-GLM unit test · 90c942d1
      Guido Trotter authored
      I was hunting for a bug in my code and thought the culprit was in the
      locking library, so I added a test to check. Unfortunately turns out it
      wasn't. :( Committing the test anyway, while still trying to figure out
      what's wrong...
      
      Reviewed-by: imsnah
      90c942d1
  7. Aug 11, 2008
  8. Jul 31, 2008
  9. Jul 30, 2008
  10. Jul 29, 2008
    • Iustin Pop's avatar
      Add a KillProcess function · b2a1f511
      Iustin Pop authored
      We cannot depend on all environments to have a start-stop-daemon or
      similar tool. We instead implement a KillProcess function that behaves
      similar to “start-stop-daemon --retry”.
      
      Note that the attached unittest can hang in foreground if the child
      misbehaves (doesn't write to the internal pipe). Since unittest are
      either run in the foreground or are run with a timeout from an automated
      framework, I think this is an acceptable trade-off (against of using
      hardcoded timeouts in the test).
      
      Reviewed-by: imsnah
      b2a1f511
    • Iustin Pop's avatar
      Change IsPidFileAlive into ReadPidFile · d9f311d7
      Iustin Pop authored
      We already have a function to test if a PID is alive, so it makes more
      sense to use function composition that force calling (since we need to
      read PIDs from files in other places too). Now IsProcessAlive returns
      False for PIDs <= 0, since this is the error return from ReadPidFile.
      
      The patch also adds a unittest for checking that WriteFile raises the
      correct exception, and checks that an invalid or missing file causes
      ReadPidFile to return zero. The unittest tearDown method will try to
      cleanup the temp directory too (otherwise it leaves stuff after it).
      
      Reviewed-by: ultrotter
      d9f311d7
  11. Jul 28, 2008
  12. Jul 24, 2008
  13. Jul 23, 2008
    • Guido Trotter's avatar
      Invert nodes/instances locking order · 04e1bfaf
      Guido Trotter authored
      An implementation mistake from the original design caused nodes to be
      locked before instances, rather than after. This patch inverts the level
      numbering, changing also the relevant unittests and the recursive
      locking function starting point.
      
      Reviewed-by: iustinp
      04e1bfaf
  14. Jul 22, 2008
  15. Jul 11, 2008
  16. Jul 09, 2008
  17. Jul 08, 2008
    • Guido Trotter's avatar
      Add a more comment lines to testLockingConstants · b10b9d74
      Guido Trotter authored
      This is to discourage even more whoever may think that this requirement
      is not really useful and can be lifted, and to at least know where it's
      used before trying to break it.
      
      Reviewed-by: imsnah
      b10b9d74
    • Guido Trotter's avatar
      Add a new LockSet unittest · 2e1d6d96
      Guido Trotter authored
      This test checks the LockSet behaviour when an empty list is passed.
      The current behaviour is expected, but since this is a corner case,
      we're safer to keep it under a check, and if we need a different one
      monitor that everything is as we expect it to be.
      
      Reviewed-by: imsnah
      2e1d6d96
    • Guido Trotter's avatar
      Pass context to LUs · 77b657a3
      Guido Trotter authored
      Rather than passing a ConfigWriter to the LUs we'll pass the whole
      context, from which a ConfigWriter can be extracted, but we can also
      access the GanetiLockManager. This also fixes the places where a FakeLU
      is created.
      
      Reviewed-by: iustinp
      77b657a3
    • Guido Trotter's avatar
      mocks: create a FakeContext object · f4555db2
      Guido Trotter authored
      This will be passed to FakeLUs
      
      Reviewed-by: iustinp
      f4555db2
    • Guido Trotter's avatar
      Locking: remove LEVEL_CONFIG lockset · 08a6c581
      Guido Trotter authored
      Since the ConfigWriter now handles its own locking it's not necessary to
      have a specific level for the config in the Locking Manager anymore.
      This patch thus removes it, and all the unittest calls that used it, or
      depended on it being present.
      
      Reviewed-by: iustinp
      08a6c581
    • Guido Trotter's avatar
      Locking: add ssynchronized decorator · 42a999d1
      Guido Trotter authored
      This patch creates a new decorator function ssynchronized in the locking
      library, which takes as input a SharedLock, and synchronizes access to
      the decorated functions using it. The usual SharedLock semantics apply,
      so it's possible to call more than one synchronized function at the same
      time, when the lock is acquired in shared mode, and still protect
      against exclusive access.
      
      The patch also adds a few unit test to check the basic decorator's
      functionality, and to provide an example on how to use it.
      
      Reviewed-by: iustinp
      42a999d1
  18. Jul 04, 2008
  19. Jul 01, 2008
  20. Jun 30, 2008
  21. Jun 23, 2008
  22. Jun 19, 2008
Loading