1. 09 Nov, 2012 1 commit
  2. 08 Nov, 2012 1 commit
  3. 29 Oct, 2012 1 commit
  4. 25 Oct, 2012 1 commit
  5. 24 Oct, 2012 3 commits
  6. 19 Oct, 2012 2 commits
  7. 18 Oct, 2012 2 commits
    • Christos Stavrakakis's avatar
      Reconnect to different Broker if idle for too long · 0456269f
      Christos Stavrakakis authored
      Modify snf-dispatcher and add a timeout option to basic_wait method.  If
      timeout is reached, the connection to the current RabbitMQ broker is
      closed and dispatcher tries to connect to a different one.
      
      This commit is supplementary of 6d27ead, which detects connection
      failures using the TCP keepalive feature. However, while the connection
      is active, the RabbitMQ broker may have a problem. This commit tries
      to detect such problems, and considers idle connections such a case.
      0456269f
    • Christos Stavrakakis's avatar
      Detect and handle connection problems in amqp_puka · 4e91219d
      Christos Stavrakakis authored
      Use the TCP keepalive feature in amqp_puka in order to detect connection
      errors to the RabbitMQ broker, and retry to a different one. Also setup
      the keepalive parameters to relative small values, to detect failures
      relatively soon.
      
      Also, modify and-dispatcher to use the AMQP prefetch_count option of the
      basic_consume method, which makes the RabbitMQ broker to not deliver
      more than prefetch_count messages to the snf-dispatcher, before
      receiving acknowledgement for the previous messages.
      4e91219d
  8. 11 Oct, 2012 2 commits
  9. 10 Oct, 2012 1 commit
    • Christos Stavrakakis's avatar
      Various fixes about logging · 946179e0
      Christos Stavrakakis authored
      Fix logging from snf-manage commands. Modify snf-manage implementation
      in order to setup the loggers for all snf-manage commands. Configuration
      is based on SNF_MANAGE_LOGGING_SETUP setting from snf-common or on
      basicConfig if that setting is missing.
      
      Also modify dispatcher to setup his own logger, instead of obsolete
      DISPATCHER_LOGGING setting.
      946179e0
  10. 09 Oct, 2012 1 commit
    • Vangelis Koukis's avatar
      Fix duplicate return of HTTP connection into pool · 0d2e0415
      Vangelis Koukis authored
      Fix duplicate return of HTTP connection into pool on duplicate
      invocation of conn.close().
      
      Revert commit b9c834003, and make sure a connection object's _pool
      attribute is re-initialized whenever it is retrieved from the pool.
      For the time being, this is done in _pool_verify().
      
      Also introduce distinct HTTP connection pools for every
      (scheme, netloc) combination. The previous code would fail if a
      user attempted to get_http_connection() both for "http://host" and
      for "https://host", reusing the same pool for both.
      0d2e0415
  11. 08 Oct, 2012 2 commits
  12. 05 Oct, 2012 1 commit
  13. 03 Oct, 2012 1 commit
    • Christos Stavrakakis's avatar
      Pool Ganeti RAPI clients · eb344b41
      Christos Stavrakakis authored
      - Move Ganeti RAPI client from snf-common to snf-cyclades-app/logic.
      - Create GanetiRapiClientPool for pooling GanetiRapiClient objects
      - Create context manager in db.models for pool handling
      - Update code using the RAPI client
      eb344b41
  14. 27 Sep, 2012 9 commits
    • Christos Stavrakakis's avatar
      Fix cleanup of DB pooled connections · f179fe89
      Christos Stavrakakis authored
      Fix bug in cleanup of DB pooled connections before putting them back to
      the pool. The way the connection was cleaned, resulted in mishandling of
      the transactions.
      
      Accoring to psycopg2 docs, in case of a READ COMMITED isolation level:
      
        "A new transaction is started at the first execute() command on a cursor
        and at each new execute() after a commit() or a rollback()".
      
      Cleaning the connection by executing "ABORT;RESET ALL", resulted in
      starting a new transaction which was immediatly aborted:
      
         BEGIN; SET TRANSACTION ISOLATION LEVEL READ COMMITTED
         ABORT; RESET ALL
      
      Also this resulted in database queries that were executed in connections
      from pool, to possible run without being inside a transaction.
      f179fe89
    • Christos Stavrakakis's avatar
      a9cb7d38
    • Christos Stavrakakis's avatar
      Fix bug in http connection pool · a582c6b3
      Christos Stavrakakis authored
      Do not reset connetion _pool attribute, since it is not (yet?)
      initialized when getting the object from the pool.
      a582c6b3
    • Georgios D. Tsoukalas's avatar
      remove obsolete kwarg verify · e5753bdb
      Georgios D. Tsoukalas authored
      e5753bdb
    • Georgios D. Tsoukalas's avatar
      9282e07a
    • Georgios D. Tsoukalas's avatar
      complete some functionality · c162e4d5
      Georgios D. Tsoukalas authored
      c162e4d5
    • Georgios D. Tsoukalas's avatar
      Enhance pooling API, implementation, and tests · d8b3bc50
      Georgios D. Tsoukalas authored
      - Verify objects (new and old) with a hook _pool_verify.
        Discard objects from the pool that fail verification.
        A newly created object failing verification is fatal.
      
      - Remove all hooks from the pool set access critical section.
        This makes pooling overhead minimal, and independent from hooks.
        However, this requires the hooks to be thread safe
        (but this is not restricting, since
         if you are single-threaded, almost everything is safe,
         and if you are multi-threaded, then you must already be thread safe)
      
      - Fix typos, and (some) non-deterministic assertions in tests
      
      - Make test pool hooks thread safe and add a thread safety test.
      
      - Refactor http connection pool to use new pools.
      d8b3bc50
    • Georgios D. Tsoukalas's avatar
      don't take mutex for cleanup · 46efa1a9
      Georgios D. Tsoukalas authored
      46efa1a9
    • Christos Stavrakakis's avatar
      Fix broken logging · 14adc202
      Christos Stavrakakis authored
      Rename LOGGING setup to LOGGING_SETUP, as this name is required by
      the LoggingConfigMiddleware. Django's default LOGGING setting can
      be used with Django>=1.3
      
      Also change default handler to 'console' and add a more verbose format.
      14adc202
  15. 18 Sep, 2012 1 commit
    • Christos Stavrakakis's avatar
      Fix cleanup of DB pooled connections · de14cfe9
      Christos Stavrakakis authored
      Fix bug in cleanup of DB pooled connections before putting them back to
      the pool. The way the connection was cleaned, resulted in mishandling of
      the transactions.
      
      Accoring to psycopg2 docs, in case of a READ COMMITED isolation level:
      
        "A new transaction is started at the first execute() command on a cursor
        and at each new execute() after a commit() or a rollback()".
      
      Cleaning the connection by executing "ABORT;RESET ALL", resulted in
      starting a new transaction which was immediatly aborted:
      
         BEGIN; SET TRANSACTION ISOLATION LEVEL READ COMMITTED
         ABORT; RESET ALL
      
      Also this resulted in database queries that were executed in connections
      from pool, to possible run without being inside a transaction.
      de14cfe9
  16. 12 Sep, 2012 2 commits
  17. 10 Sep, 2012 1 commit
    • Christos Stavrakakis's avatar
      Fix broken logging · 7d20308a
      Christos Stavrakakis authored
      Rename LOGGING setup to LOGGING_SETUP, as this name is required by
      the LoggingConfigMiddleware. Django's default LOGGING setting can
      be used with Django>=1.3
      
      Also change default handler to 'console' and add a more verbose format.
      7d20308a
  18. 07 Sep, 2012 8 commits