mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-23 16:12:25 +02:00
Fixes a critical deadlock that occurs when _load_diff_chains calls self._cursor() from within _load_blobs while the outer _load_checkpoint_tuple already holds self._cursor(). On bare (non-pool) connections, the threading.Lock is not reentrant, causing a deadlock. Solution: Pass the cursor as a parameter to _load_diff_chains and _load_blobs instead of acquiring a new cursor within those methods. Updated _load_checkpoint_tuple to acquire a cursor once at the top level and pass it through the call chain. Changes: - Updated _load_blobs signature to accept optional cur parameter - Updated _load_diff_chains signature (base and implementations) to accept optional cur parameter - Modified _load_checkpoint_tuple in PostgresSaver to acquire cursor and pass it - Modified _load_checkpoint_tuple_async to acquire cursor only when diff_payloads exist - Removed nested self._cursor() calls in _load_diff_chains and _load_diff_chains_async Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>