Skip to content

feat: prevent connection leak during BeginTx context cancellation - #8

Open
laurentketterle-hub wants to merge 1 commit into
raimeecas:mainfrom
laurentketterle-hub:feat/safe-begin-tx-pool
Open

feat: prevent connection leak during BeginTx context cancellation#8
laurentketterle-hub wants to merge 1 commit into
raimeecas:mainfrom
laurentketterle-hub:feat/safe-begin-tx-pool

Conversation

@laurentketterle-hub

Copy link
Copy Markdown

Summary

Prevent connection leak to pool when context is cancelled during BeginTx().

Changes

  • Added SafeBeginTx() wrapper with proper context handling
  • Goroutine-based BeginTx with timeout and cancellation recovery
  • Automatic rollback on context cancellation to return connection to pool
  • Graceful cleanup when context cancelled with fallback timeout

Tests

  • Unit tests for cancelled context
  • Unit tests for timeout scenarios
  • Integration test for pool connection recovery
  • Pool stats verification after cancellation

CI

  • Added Go CI workflow with test, vet, and build checks

Closes #2

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.

🎯 Prevent Connection Leak to Pool on Context Cancellation during BeginTx()

1 participant