fix: client didn't get rotated when creating a new pool#748
fix: client didn't get rotated when creating a new pool#748patricios-space wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes TON client rotation when creating/using connection pools by moving from a single shared ConnectionPool to per-node pools keyed by node index, ensuring each node can maintain its own long-lived pool.
Changes:
- Replace
chain.poolwithchain.pools map[int]*liteclient.ConnectionPoolto track pools per node. - Update pool lifecycle management: create pools per node on demand and stop all pools on
Close().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { // restrict scope of read lock | ||
| c.cacheMu.RLock() | ||
| defer c.cacheMu.RUnlock() |
There was a problem hiding this comment.
This scoped { does not release the read lock at the end of the } block, defer is only triggered when functions return, so i think this will deadlock on line 475 with c.cacheMu.Lock()
There was a problem hiding this comment.
tested this in go playground: https://goplay.tools/snippet/w5sy6rGXJLA
There was a problem hiding this comment.
Good to know. Thought this worked differently. Too much Rust 🦀
ogtownsend
left a comment
There was a problem hiding this comment.
RC for the potential deadlock
No description provided.