Skip to content

1.19.1

Choose a tag to compare

@jensens jensens released this 05 Nov 00:52
8622cf3

Bug fixes

  • Fix: a failover no longer strands ZODB connections with their full cache
    (#142).
    ZODB polls in Connection.open() and in every
    transaction.abort(). While PostgreSQL was unreachable,
    poll_invalidations() raised OperationalError or PoolTimeout there.
    DB.open() then never returned the connection, and Zope's publisher
    skipped close() after the failing abort(). A connection that is never
    closed is never freed, so every request in flight during a failover left
    its connection and its whole object cache in memory, and the process grew
    with every failover. Now poll_invalidations() returns None on any
    psycopg.OperationalError, which tells ZODB to invalidate its whole
    cache. The next access to the instance's PostgreSQL connection, and every
    load() and load_multiple() before it consults the shared cache,
    repeats the poll first, so reads get a fresh snapshot. Other exceptions
    still propagate. The traceback is logged once per outage, later failures
    log one line each.

    OperationalError covers more than an unreachable server: it includes
    PoolTimeout, QueryCanceled (statement_timeout), lock and disk
    errors. A flushed cache is cheaper than a stranded connection in all of
    them, but it has costs:

    • After a failover each connection reloads its objects once.
    • If the pool is exhausted under load while PostgreSQL is healthy, the
      whole object cache is flushed, and the reloads add load while the pool
      is saturated.
    • If the poll query itself keeps failing (for example a persistent
      QueryCanceled), every transaction flushes the cache and every read
      fails.

New features

  • Declare and test Python 3.15 support: trove classifier and CI test matrix.
    The test suite passes on 3.15.0 without code changes.

Documentation

  • Fix the write path sequence diagram in the architecture explanation. The
    ; in BEGIN; pg_advisory_xact_lock(0) ends a Mermaid statement, so the
    diagram rendered as "Syntax error in text"; it is now written as #59;.

  • Move the reasoning behind the S3 timeout keys from the S3 how-to into the
    architecture explanation, turn the how-to section into concrete steps with a
    configuration example, mark the keys as added in 1.19, document
    ZODB_PGJSONB_IDLE_IN_XACT_TIMEOUT_MS, and list the zodb-s3blobs>=1.2.0
    requirement in the dependency table.

Assisted-by: Claude Opus 5.5