SessionPool acquire: growth/hand-out failures bypass acquire_timeout budget; live counter decremented outside the state lock loses Condvar wakeups; acquire_timeout = Duration::MAX panics
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 62/100
Research direction
Start by locating SessionPool::acquire and tracing the open_session growth path and hand_out USE replay path, then inspect every live mutation relative to the state lock and Condvar notification. Verify that failures retry until the original deadline, live decrements notify waiters under the lock, and Duration::MAX waits without overflow; reproduce the behavior with fake-listener stress tests.
Written by the indexing model from the issue text.
Description
Three related pool-accounting defects found by stress-testing SessionPool against fake listeners:
acquire()spends none of itsacquire_timeoutbudget when the growth branch fails. Whenopen_session()fails,acquire()returns the error immediately (measured 198us against a 5s budget; 4136 of 4800 acquires failed instantly under stress while sessions were circulating). The same happens when theUSEreplay inhand_outfails — it discards the remaining idle candidates instead of retrying the loop.liveis decremented outside thestatelock at several sites, and the decremented value is exactly the predicate parked waiters re-evaluate, so Condvar notifications can be lost. The comment "Only mutated while holdingstate" no longer matches the code. Measured stalls trackacquire_timeoutexactly (300ms → 305ms, 1000ms → 1.005s).acquire_timeout = Duration::MAXpanics onInstant::now() + acquire_timeoutoverflow before the lock is taken. There is no "never time out" option, andDuration::MAXis the natural way to ask for one.
Fix: on growth/hand-out failure, re-take the lock, decrement live under it, notify, and continue the loop (bounded by the original deadline); use a saturating deadline (checked_add) so Duration::MAX means "wait without timeout".
- Dominant language
- Rust
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/iotdb-client-rust
-
Session::open does not fail over when openSession/requestStatementId fails (only TCP-layer failover) Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 65/100
apache/iotdb-client-rust#10 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
All issues in apache/iotdb-client-rust
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100