Skip to main content

Upgrading to v3.1.0

Practical setup guides, performance tuning for free-threaded Python, migration workflows, and upgrade notes.

v3.1.1
Updated from GitHub 10/18/2026
Edit on GitHub

3. Upgrading to v3.1.0

NimbusKV v3.1.0 is an infrastructure-hardening release. Public API signatures remain backwards compatible with v3.0.x, but two critical behavioral improvements were introduced:

1. Deterministic Write Mutex

Prior versions (v3.0.0 through v3.0.1) used an optimistic CAS retry loop. Under hot keys with high thread counts, this caused retry storms and CPU churn. v3.1.0 replaces CAS with a single short write mutex, giving deterministic throughput.

2. ReentrantWriteError Detection

Attempting to call write operations (set(), delete()) from inside an atomic() or mutate() callback now raises an immediate ReentrantWriteError rather than deadlocking.

upgrade_example.py
from nimbuskv import NimbusKV
from nimbuskv.exceptions import ReentrantWriteError
store = NimbusKV()
store.set("counter", 10)
# Correct atomic pattern:
def increment(val):
return (val or 0) + 1
store.atomic("counter", increment)
print(store.get("counter")) # 11