pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/net/py-pyrate-limiter
Module Name: pkgsrc
Committed By: adam
Date: Tue Oct 27 08:16:13 UTC 2026
Modified Files:
pkgsrc/net/py-pyrate-limiter: Makefile distinfo
Log Message:
py-pyrate-limiter: updated to 4.5.1
4.5.1
Bug fixes only. One behaviour change to note: a decorated call that the limiter
can never admit now raises instead of running (see the first entry).
Fixed
- **`as_decorator` ran the wrapped function even when denied.** Both the sync
and async wrappers discarded the result of `try_acquire()` and called the
function unconditionally. With the default `blocking=True, timeout=-1` that
result is only `False` when the weight can never be admitted under the
configured rates (e.g. `weight=5` on `Rate(2, Duration.SECOND)`), so the
limiter's verdict was silently bypassed. Such calls now raise `RuntimeError`.
- **`Limiter.close()` never closed its buckets.** `BucketFactory.close()` read
the bucket list off the leaker after tearing the leaker down, so it always
iterated an empty list: SQLite connections and Postgres connection pools
stayed open. It now snapshots the buckets first. `SingleBucketFactory` also
closes its bucket when no leak was ever scheduled; factories that hold buckets
outside the leaker can extend the new `BucketFactory.owned_buckets()`.
- **Async wrappers lost `StateBucket` waits.** `BucketAsyncWrapper.waiting()`
called the generic log-bucket implementation instead of the wrapped bucket's,
so GCRA / `TokenBucket` waits came back as `-1` or `0`. An admissible request
could be rejected outright, or a blocking limiter could retry without waiting.
- **Async blocking retries recorded stale timestamps.** After an async wait the
retry loop advanced the item's timestamp by the requested delay only. A late
wake-up therefore recorded the acquisition in the past and let later requests
through early. The timestamp is now re-read from the bucket factory's clock,
and the deadline is enforced around the whole retry loop.
- **PostgresBucket**: the advisory lock that serialises table creation is now
keyed by a CRC-32 of the table name rather than `hash()`, which Python salts
per interpreter. Processes sharing a database took different locks, so their
concurrent `CREATE TABLE IF NOT EXISTS` could fail with `UniqueViolation` on
`pg_type_typname_nsp_index`.
- **`PostgresBucket.peek` read timestamps as UTC.** The `item_timestamp` column
is a `TIMESTAMP` that `TO_TIMESTAMP` fills through the session time zone, but
`peek` took its epoch as if it were UTC. Outside UTC every peeked item sat the
zone's offset in the future, so a full bucket computed a wait of that many
hours and blocking callers slept through it. `peek` now casts the column back
through the session zone.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 pkgsrc/net/py-pyrate-limiter/Makefile \
pkgsrc/net/py-pyrate-limiter/distinfo
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/net/py-pyrate-limiter/Makefile
diff -u pkgsrc/net/py-pyrate-limiter/Makefile:1.5 pkgsrc/net/py-pyrate-limiter/Makefile:1.6
--- pkgsrc/net/py-pyrate-limiter/Makefile:1.5 Thu Sep 3 11:14:17 2026
+++ pkgsrc/net/py-pyrate-limiter/Makefile Tue Oct 27 08:16:13 2026
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.5 2026/09/03 11:14:17 adam Exp $
+# $NetBSD: Makefile,v 1.6 2026/10/27 08:16:13 adam Exp $
-DISTNAME= pyrate_limiter-4.5.0
+DISTNAME= pyrate_limiter-4.5.1
PKGNAME= ${PYPKGPREFIX}-${DISTNAME:S/_/-/}
CATEGORIES= net python
MASTER_SITES= ${MASTER_SITE_PYPI:=p/pyrate-limiter/}
Index: pkgsrc/net/py-pyrate-limiter/distinfo
diff -u pkgsrc/net/py-pyrate-limiter/distinfo:1.5 pkgsrc/net/py-pyrate-limiter/distinfo:1.6
--- pkgsrc/net/py-pyrate-limiter/distinfo:1.5 Thu Sep 3 11:14:17 2026
+++ pkgsrc/net/py-pyrate-limiter/distinfo Tue Oct 27 08:16:13 2026
@@ -1,5 +1,5 @@
-$NetBSD: distinfo,v 1.5 2026/09/03 11:14:17 adam Exp $
+$NetBSD: distinfo,v 1.6 2026/10/27 08:16:13 adam Exp $
-BLAKE2s (pyrate_limiter-4.5.0.tar.gz) = 3a50427db0a4a16a94df12b4f919b29c16d6d37a194fabc03140b44602e86de6
-SHA512 (pyrate_limiter-4.5.0.tar.gz) = 35ee3bef555260df68ad1881d64b72f7a51535e164abf640c133ac96c5caa4073b56a43edc30cdb982d1e322f9b01f6eccc8edbb6d94be84046be11a305074b7
-Size (pyrate_limiter-4.5.0.tar.gz) = 123240 bytes
+BLAKE2s (pyrate_limiter-4.5.1.tar.gz) = f40f93e9297d9189b1b93a6ea60675f53dfb2343fc79a720c846db1c250cac3f
+SHA512 (pyrate_limiter-4.5.1.tar.gz) = 3f0663ef99c347750ee1cc4e7a629d64b898b4dcf92760672e3cab3d7399430caf6ada1c4e5fb9f2af0fff4e60c9e1546878bd7ed8a34f9f297653fef9cd6140
+Size (pyrate_limiter-4.5.1.tar.gz) = 129966 bytes
Home |
Main Index |
Thread Index |
Old Index