Commit a05854a
Add connection identity to the rollback-failure DEBUG log
The AsyncAdaptedConnection.close rollback-failure DEBUG log named
the exception class but not the connection. In a pool of 20 async
connections churning several pool events per second, that produces
a stream of identical lines with no way to tell which adapter or
which peer is misbehaving.
Include id(self) and the peer address from the wrapped dbapi
connection so operators can correlate log records to specific
adapter instances and cluster nodes. id(self) is chosen over
id(self._connection) because SQLAlchemy's pool tracks the outer
adapter — that's the natural correlation handle. Peer address is
looked up defensively via getattr(..., "address", None) so the
log never fails on an adapter constructed in a test harness.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent cf38d1e commit a05854a
2 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
247 | 250 | | |
248 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
249 | 255 | | |
250 | 256 | | |
251 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| |||
0 commit comments