Skip to content

Conversation

@zhanghaitao3
Copy link

This commit addresses a deadlock issue occurring when a prepared statement becomes invalid (e.g., after DDL changes).

Key changes:

  1. Protocol Safety: Hardened protocol.pyx exception handling to ensure waiter.set_exception() is always called, preventing the executor from hanging indefinitely if exception construction fails.
  2. Retry Logic: Updated connection.py to catch generic GaussDBError alongside specific cache errors, ensuring robust detection.
  3. Protocol Sync: Added a brief asyncio.sleep(0.05) delay before retrying. This allows the underlying socket to process the ReadyForQuery frame and reset the protocol state properly.
  4. Cache Cleanup: Enforced clearing of both local and global statement caches upon error.

This commit addresses a deadlock issue occurring when a prepared statement becomes invalid (e.g., after DDL changes).

Key changes:
1. Protocol Safety: Hardened protocol.pyx exception handling to ensure waiter.set_exception() is always called, preventing the executor from hanging indefinitely if exception construction fails.
2. Retry Logic: Updated connection.py to catch generic GaussDBError alongside specific cache errors, ensuring robust detection.
3. Protocol Sync: Added a brief asyncio.sleep(0.05) delay before retrying. This allows the underlying socket to process the ReadyForQuery frame and reset the protocol state properly.
4. Cache Cleanup: Enforced clearing of both local and global statement caches upon error.
@5xuanwen 5xuanwen merged commit d05f8a2 into HuaweiCloudDeveloper:master Nov 28, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants