Skip to content
Snippets Groups Projects
  1. Aug 28, 2012
  2. Aug 24, 2012
  3. Aug 13, 2012
    • Iustin Pop's avatar
      Add a server-side Luxi implementation · 13f2321c
      Iustin Pop authored
      
      This is a trivial code change, but it allows us to finally test the
      send-receive code on both client and server sides via a simple
      in-process server.
      
      The unittest works, but it won't handle timeouts very nicely; it will
      wait until the actual Luxi timeout expires, instead of using much
      shorter timeouts as we could in the same process.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      13f2321c
    • Iustin Pop's avatar
      Switch the Luxi interface from Strings to ByteStrings · e821050d
      Iustin Pop authored
      
      I'm doing this change for future performance optimisations. Currently
      we use the Luxi interface just as a client, so not in the hot path,
      but when we'll use this as a server interface, we're interested to
      both reduce the space and time consumption of the interface.
      
      We have to simultaneous changes here:
      
      - switch from using socket-related function (sendto, recv, etc.) to
        handle-based functions, since the standard network library doesn't
        work with sockets
      - switch from using Strings for the internal buffer to strict
        ByteStrings; the only downside is that we now have the issue of
        decoding/encoding from binary to UTF-8 strings, a fact which brings
        its own issues into the mix (we have to check for failed decodings,
        etc.); but this is similar to what we'll have to handle on the
        Python side when moving to Python 3.x
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      e821050d
  4. Aug 07, 2012
    • Iustin Pop's avatar
      Switch job IDs to numeric · 76b62028
      Iustin Pop authored
      
      This has been a long-standing cleanup item, which we've always
      refrained from doing due to the high estimated effort needed.
      
      In reality, it turned out that after some infrastructure improvements
      (the previous patches), the actual job queue-related changes are quite
      small.
      
      We will need to update the NEWS file later, but so far the RAPI
      documentation doesn't mention that the job ID is a string (it only
      says it is "a number"), so it doesn't look like it needs update.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      76b62028
  5. Jul 31, 2012
  6. Jul 27, 2012
  7. Jul 19, 2012
  8. Jul 06, 2012
    • Iustin Pop's avatar
      Replace a few explicit case expressions · 76ae2e5b
      Iustin Pop authored
      
      Since we're just talking about converting Maybe into another monad, we
      can do that via the maybe function, instead of explicit casing.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      76ae2e5b
    • Iustin Pop's avatar
      Fix Haskell coverage results · 96eccc1f
      Iustin Pop authored
      
      There are two current issues with the coverage values:
      
      - we don't import all modules, thus leading to incomplete
        coverage results (too optimistic);
      - we use hpc in its default mode (intersection), which means that even
        modules which do have coverage results but are not used in all
        binaries we test will be dropped from the results; thanks to Agata,
        passing --union to hpc is enough to have better results (don't
        remember why this wasn't there in the first place…)
      
      After adding more modules to the import list and fixing the combining
      mode, we now have a complete list of modules in coverage results, many
      with zero coverage, so our overall coverage has dropped to about 60%.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      96eccc1f
    • Iustin Pop's avatar
      Cleanup the QC.hs file w.r.t. compiler options · fce98abd
      Iustin Pop authored
      
      Currently, we build the Haskell unittests with custom GHC flags,
      because we (I) were quite lazy when initially writing the
      unittests. This is not a problem for the tests themselves, but it
      creates problem when (for example) one would want to pass all
      $(HS_LIB_SRCS) to the compilers; this is not doable unless we
      "degrade" the flags used for all modules, instead of just for QC.hs.
      
      So we do two things to fix this:
      
      - first, we go and add type declaration to all functions that were
        missing them (in QC), and fix the couple of cases of monomorphism
        restrictions; this gets us rid of -fno-warn-missing-signature and
        -fno-warn-monomorphism-restriction
      - then, we move the actually important remaining options
        (-fno-warn-orphans and -fno-warn-unused-imports; see the explanation
        for the latter in the newly added FIXME) to a compiler pragma in the
        file, so that when building the unittests only this file is using
        the extra options
      
      And finally we can then drop the other unused options
      (-fno-warn-missing-methods anmd -Wwarn), leaving htools/test use
      simply -fhpc. This is more in-line with the other files, and thus we
      can handle all of HS_LIB_SRCS the same.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      fce98abd
    • Iustin Pop's avatar
      Fix Query2.hs to compile without warnings · b647b6d7
      Iustin Pop authored
      
      Since this is not yet used by any targets, we didn't detect yet the
      compilation warnings. Just trivial exports/imports cleanup.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
      b647b6d7
  9. Jul 05, 2012
    • Iustin Pop's avatar
      hbal: return exit status 0 in case of early exit · 2a2e2610
      Iustin Pop authored
      
      This derives from an internal bug, but the story is consistent across
      both internal and external usage of hbal.
      
      Basically right now, hbal returns exit code 1 if requested to exit
      early, even if all jobs are successful. This is counter-intuitive due
      to two reasons:
      
      - hbal did what it was requested (exit early), so it shouldn't return error
      - there were no job failures, so there's nothing to "cleanup" or
        investigate on the Ganeti cluster, so again it shouldn't return
        error
      
      Therefore the new behaviour is as follows:
      
      - for cases where all jobs were successful, even if terminated early
        via SIGINT or via --limit, we exit with code 0
      - for cases where jobs have failed or there were other errors in
        running hbal, the exit code is 1
      - for cases were hbal is requested an immediate termination (SIGTERM),
        exit code is 2, denoting "unknown whether the Ganeti cluster is
        consistent or not"
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
      2a2e2610
  10. Jun 29, 2012
    • Iustin Pop's avatar
      hcheck: add two simple type aliases for readability · 7f119c27
      Iustin Pop authored
      
      The same types are reused a couple of times, so let's add a couple of
      type aliases for easier change later and readability.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
      7f119c27
    • Iustin Pop's avatar
      hcheck: rework output mode · 4b77c2a2
      Iustin Pop authored
      
      Looking at the output of hcheck, in human readable mode, it looks like
      it always starts with a blank line. This is not nice, so I wanted to
      redo this to start cleanly.
      
      However, looking at the code, I realised that we need some internal
      cleanup; 'perGroupChecks' was doing both pure computation (computing
      the score/stats) and I/O work (printing the stats), which is ugly, so
      I split that in two; this allows perGroupChecks to be simpler, and we
      can therefore first compute the group stats, and start the output with
      the mode in which we run.
      
      So right now, hcheck will first output whether we need to run a
      rebalance, or if no-simulation is selected, etc., and only then
      display the actual stats, making the output a bit more consistent.
      
      Signed-off-by: default avatarIustin Pop <iustin@google.com>
      Reviewed-by: default avatarAgata Murawska <agatamurawska@google.com>
      4b77c2a2
Loading