1. 11 Jan, 2013 1 commit
  2. 09 Jan, 2013 4 commits
  3. 20 Dec, 2012 1 commit
  4. 19 Dec, 2012 1 commit
    • Iustin Pop's avatar
      Fix job completion with big job queues · e0f470ac
      Iustin Pop authored
      Accidentally stumbled upon this while testing unrelated code on a
      machine with ~3K active jobs - the bash completion unittest was
      Upon investigation, it turns out that bash's ${var//pattern/repl/} is
      probably quadratic in the size of input (or worse, even):
        $ touch job-{1..500}
        $ time ( a=$(echo job-*); echo ${a//job-/}| wc -c; )
        real    0m0.597s
        user    0m0.590s
        $ touch job-{1..1000}
        $ time ( a=$(echo job-*); echo ${a//job-/}| wc -c; )
        real    0m4.654s
        user    0m4.580s
      We can easily fix this if we change to array-based substitution (once
      per element):
        $ time ( a=($(echo job-*)); echo ${a[*]/job-/} |wc -c; )
        real    0m0.028s
        user    0m0.010s
        $ touch job-{1..10000}
        $ time ( a=($(echo job-*)); echo ${a[*]/job-/} |wc -c; )
        real    0m0.233s
        user    0m0.220s
      This means that exactly when the master node is busy processing many
      jobs, we could accidentally start consuming lots of CPU in the bash
      completion, which is not good.
      Note: the code might have problems with filenames containing spaces (I
      didn't reset the IFS, etc.), but the original code had the same issue,
      I think.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
  5. 14 Dec, 2012 3 commits
  6. 13 Dec, 2012 2 commits
  7. 12 Dec, 2012 2 commits
  8. 22 Nov, 2012 1 commit
  9. 19 Nov, 2012 1 commit
    • Iustin Pop's avatar
      Fix opcode validation for OpOobCommand.command · 70296981
      Iustin Pop authored
      The 'command' attribute of the OpOobCommand command is defined with a
      default value of None, but its validation requires a member of
      constants.OOB_COMMANDS, which doesn't accept None. This result in the
      following error when submitting an opcode without the command:
        error type: wrong_input, error details:
        Parameter 'OP_OOB_COMMAND.command' fails validation
      I suspect this was simply a mistake, since the commit that introduced
      it (65e183af
      , “opcodes: Add opcode parameter definitions”) did lots of
      bulk updates.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
  10. 15 Nov, 2012 1 commit
  11. 14 Nov, 2012 1 commit
  12. 12 Nov, 2012 3 commits
    • Iustin Pop's avatar
      Improve error message when migration status fail · 4041a4e3
      Iustin Pop authored
      Commit 6a1434d7
       (“Make migration RPC non-blocking”) changed the API
      for reporting migration status, but has a small cosmetic bug: if the
      migration status if failure, but the RPC itself to get the status
      didn't fail, it shows the following error message:
        Could not migrate instance instance2: None
      since it always uses result.fail_msg, irrespective of which part of
      the if condition failed.
      This patch simply updates the msg if not already set, leading to:
        Could not migrate instance instance2: hypervisor returned failure
      Proper error display can be done once the migration status objects can
      return failure information as well, beside status.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
    • Iustin Pop's avatar
      Fix type error in kvm/GetMigrationStatus · 62457f51
      Iustin Pop authored
      Commit 6a1434d7
       (“Make migration RPC non-blocking”) changed from
      raising HypervisorErrors to returning MigrationStatus
      objects. However, these objects don't have an "info" attribute, so
      they can't pass a reason back (which is in itself a bug); but the KVM
      hypervisor code attempts to do so, and fails at runtime with:
        Failed to get migration status: 'MigrationStatus' object has no attribute 'info'
      instead of the intended:
        Migration failed, aborting: too many broken 'info migrate' answers
      For now (on stable-2.6), let's just remove the "info" reason, and
      later we can add it back properly once we have a way to correctly
      represent migration status failures in the LU.
      This fixes issue 297.
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
    • Iustin Pop's avatar
      Fix PID file writing in Haskell daemons · a4c0fe1e
      Iustin Pop authored
      Currently, the code uses createFile, which has the effect of always
      truncating the file. This is bad, as the content of the PID file is
      wiped even when we wouldn't be able to lock it!
      We switch to openFd (createFile is just a wrapper over that), and we
      use an explicit set of flags; defaultFileFlags is already safe
      (trunc=False), but I prefer to set it explicitly with our desired
      Note that this bug doesn't manifest in normal usage, as daemon-util
      won't try to start the daemon if already running. But if anyone or
      anything does call ganeti-confd explicitly, the pid file will be
      emptied and the daemon will keep trying to be restarted forever…
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
  13. 08 Nov, 2012 4 commits
  14. 07 Nov, 2012 2 commits
    • Michael Hanselmann's avatar
      Add missing tests for commit f0d22861 · 7a70541e
      Michael Hanselmann authored
      Commit f0d22861
       changed the logic of
      gnt_instance._ConvertNicDiskModifications to also allow a parameter
      named “modify”. Unfortunately the corresponding unittest was not
      updated. An “if”/“else” condition is also merged.
      Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
      Reviewed-by: default avatarIustin Pop <iustin@google.com>
    • Iustin Pop's avatar
      Fix compatibility with newer Haskell libraries · 1251817b
      Iustin Pop authored
      This small patch fixes compatibility with a few newer Haskell libraries:
      - base 4.6, included with ghc 7.6, removed the deprecated 'catch'
        function from Prelude, so our "import Prelude hiding (catch)" is now
        an error; we workaround by using fully-qualified
        Control.Exception.catch name
      - containers 0.5 changed the signature of 'deleteFindMax'; we
        workaround by using separate 'findMax' and 'deleteMax'
      - QuickCheck 2.5 removed the 'maxDiscards' test parameter, replacing
        it with a much better 'maxDiscardsRatio'; however, until we can
        depend on that, we workaround by just removing it (we don't control
        anymore the maxDiscards, instead leaving it default; for our default
        test size, this is no change, as the default value is already 500,
        which is our default as well) and not printing it anymore
      Tested on Squeeze (+extra libs), Wheezy and experimental, which covers
      all supported GHC versions.
      Also, merging this in master will be a pain, but unless we want to
      stop supporting 2.6…
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
  15. 06 Nov, 2012 4 commits
  16. 01 Nov, 2012 6 commits
  17. 30 Oct, 2012 3 commits