Skip to content

Commit 7b12808

Browse files
committed
Fix query kes-period-info hanging indefinitely
getLocalChainTip was called inside executeLocalStateQueryExpr, opening a second node connection while the state query mux was still active. The state query thread could not fill its completionVar (and thus close connection 1) because it was blocked waiting for the second connection to return. Deadlock. Fix: use queryChainBlockNo/queryChainPoint within the existing session and reconstruct ChainTip via makeChainTip — the same pattern used by runQueryTipCmd. Fixes: #1434
1 parent af6862f commit 7b12808

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
project: cardano-cli
2+
pr: 1435
3+
kind:
4+
- bugfix
5+
description: Fix `query kes-period-info` hanging indefinitely by replacing `getLocalChainTip` (which opens a second node connection) with `queryChainBlockNo`/`queryChainPoint` state queries within the existing connection.

cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,9 @@ runQueryKesPeriodInfoCmd
381381
-- it is equivalent to what we have on disk.
382382
ptclState <- easyRunQuery (queryProtocolState sbe)
383383

384-
chainTip <- liftIO $ getLocalChainTip nodeConnInfo
384+
mChainBlockNo <- lift queryChainBlockNo & onLeft (left . QueryCmdUnsupportedNtcVersion)
385+
mChainPoint <- lift queryChainPoint & onLeft (left . QueryCmdUnsupportedNtcVersion)
386+
let chainTip = makeChainTip mChainBlockNo mChainPoint
385387

386388
let curKesPeriod = currentKesPeriod chainTip gParams
387389
oCertStartKesPeriod = opCertStartingKesPeriod opCert

0 commit comments

Comments
 (0)