pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/databases/py-lmdb



Module Name:    pkgsrc
Committed By:   adam
Date:           Thu Jul 16 11:22:38 UTC 2026

Modified Files:
        pkgsrc/databases/py-lmdb: Makefile distinfo

Log Message:
py-lmdb: updated to 2.3.0

2.3.0

Bug fixes

- ``lmdb.aio``: an async write transaction is now pinned to a private
    single-thread executor, so its ``begin``, operations, and
    ``commit``/``abort`` all run on one OS thread. Previously they were
    dispatched across the shared, multi-threaded default executor, which could
    release LMDB's thread-bound robust write mutex on the wrong thread (the
    failure mode of 465). ``AsyncCursor``/``AsyncEnvironment`` close on
    context exit now also acquire the lock and run on the executor, so closing
    can no longer race an in-flight operation on the same transaction.

- Fix committing values larger than ~2 GiB. A single LMDB value is written
    in one call, exceeding per-call platform write limits: on POSIX,
    ``write()`` returns a short count that was treated as fatal, so the
    commit failed with ``mdb_txn_commit: Input/output error``; the bundled
    liblmdb now resumes after short writes. On Windows, the compacting-copy
    writer thread passed the full length to ``WriteFile``, whose 32-bit
    length truncates; it now caps each write at 1 GiB.
    bundled liblmdb — not applied when building with ``LMDB_PURE`` or a
    system liblmdb)

- Fix silent data loss on Windows committing values near the 4 GiB maximum.
    ``mdb_page_flush`` wrote each overflow extent with a single ``WriteFile``
    whose 32-bit length truncates — an extent of exactly 4 GiB wrote nothing
    at all, committing a value of zeroes. Writes are now chunked with the
    bytes-written count checked.
    applied when building with ``LMDB_PURE`` or a system liblmdb)

- Fix 32-bit overflow in the bundled liblmdb's overflow-page byte-length
    math. For values within one page of the 4 GiB maximum, the products
    ``num * me_psize`` (dirty-page spill) and ``me_psize * (mp_pages - 1)``
    (compacting copy) wrapped on 64-bit builds, truncating the copied value
    or crashing. Both multiplications are widened to ``size_t``.
    patch to the bundled liblmdb — not applied when building with
    ``LMDB_PURE`` or a system liblmdb)

- Fix ``Environment.set_mapsize()`` invalidating open database handles.
    Since 2.2.0
    invalidated all named- and main-database handles, so a handle opened
    before the resize raised ``lmdb.Error: Database handle belongs to
    another environment`` (CPython) or an invalid-dbi ``TypeError`` (CFFI)
    on next use. Database handles hold only an integer ``MDB_dbi`` that
    stays valid across the remap, so they are now preserved; only open
    transactions and cursors are invalidated.

- Fix races between ``Environment.set_mapsize()`` and concurrent operations
    on other threads. An operation starting during the resize's remap window
    could touch the old memory map after ``munmap`` (crash or corruption); a
    write-transaction abort racing the resize could deadlock it or leave a
    transaction alive at remap time (failing the resize and invalidating the
    environment); and in the CFFI backend a write transaction beginning
    during the resize could orphan its thread-id record, deadlocking a later
    ``close()``. LMDB operations that would race a resize now fail fast with
    ``lmdb.Error`` instead; retry them after the resize completes. The CFFI
    backend now also serializes ``Transaction.get``/``put``/``delete``/
    ``stat``/``drop`` and the environment-level ``stat``/``info``/``sync``/
    ``copy``/``copyfd``/``readers``/``reader_check`` against
    ``close()``/``set_mapsize()``, closing long-standing crash races with
    ``close()`` as well. Operations racing a ``set_mapsize()`` on another
    thread now raise a transient ``lmdb.Error`` (CPython) or the CFFI
    invalid-handle ``TypeError`` instead of crashing or deadlocking.

Improvements

- The unit test suite is now type-checked in CI with both mypy and pyright,
    and the shipped stubs are validated against the runtime module with
    stubtest, so the public typed API stays usable regardless of which type
    checker downstream users run.

- Add missing ``lmdb.aio.AsyncEnvironment`` method stubs.

- ``lmdb.version(subpatch=True)`` is now correctly typed via overloads,
    returning a 4-tuple instead of a 3-tuple.

- The CFFI backend's internal reference-holding attributes ``Transaction.env``,
    ``Cursor.db``, and ``Cursor.txn`` are now private (``_pyenv``, ``_pydb``,
    ``_pytxn``). They were never exposed by the CPython extension, so this
    aligns the two backends. These were undocumented implementation details.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 pkgsrc/databases/py-lmdb/Makefile
cvs rdiff -u -r1.11 -r1.12 pkgsrc/databases/py-lmdb/distinfo

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/databases/py-lmdb/Makefile
diff -u pkgsrc/databases/py-lmdb/Makefile:1.13 pkgsrc/databases/py-lmdb/Makefile:1.14
--- pkgsrc/databases/py-lmdb/Makefile:1.13      Wed Jun 10 13:05:50 2026
+++ pkgsrc/databases/py-lmdb/Makefile   Thu Jul 16 11:22:38 2026
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.13 2026/06/10 13:05:50 adam Exp $
+# $NetBSD: Makefile,v 1.14 2026/07/16 11:22:38 adam Exp $
 
-DISTNAME=      lmdb-2.2.1
+DISTNAME=      lmdb-2.3.0
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=    databases python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=l/lmdb/}

Index: pkgsrc/databases/py-lmdb/distinfo
diff -u pkgsrc/databases/py-lmdb/distinfo:1.11 pkgsrc/databases/py-lmdb/distinfo:1.12
--- pkgsrc/databases/py-lmdb/distinfo:1.11      Wed Jun 10 13:05:50 2026
+++ pkgsrc/databases/py-lmdb/distinfo   Thu Jul 16 11:22:38 2026
@@ -1,5 +1,5 @@
-$NetBSD: distinfo,v 1.11 2026/06/10 13:05:50 adam Exp $
+$NetBSD: distinfo,v 1.12 2026/07/16 11:22:38 adam Exp $
 
-BLAKE2s (lmdb-2.2.1.tar.gz) = 230d8d78c29a3e576baea547054821893328cdc17ef6fb8908eaaf20e7323d71
-SHA512 (lmdb-2.2.1.tar.gz) = 3a20a20e0efbf8dd242a7a76c3966595c33b98d6af53f5bd38ad7c39dcbba9ab87333ae09b50ae31cd7098d3eecdce23736f000a08097a4ce345a8aa272d000d
-Size (lmdb-2.2.1.tar.gz) = 938665 bytes
+BLAKE2s (lmdb-2.3.0.tar.gz) = c13f13ce0ccac875b51a22ac311c45858dc107c6a26a911ee5668d31a958e81e
+SHA512 (lmdb-2.3.0.tar.gz) = 4e9dc23af060e20b402b8a69bb253f06f0ac9d68e09fd74a70f189f59b5b6661a9ec297bd748568717702c1316f81854407490f184f7f9a1dbaf23705f20fdc8
+Size (lmdb-2.3.0.tar.gz) = 954381 bytes



Home | Main Index | Thread Index | Old Index