Fix query kes-period-info hanging indefinitely (fixes #1434) - #1435
Open
Jimbo4350 wants to merge 1 commit into
Open
Fix query kes-period-info hanging indefinitely (fixes #1434)#1435Jimbo4350 wants to merge 1 commit into
Jimbo4350 wants to merge 1 commit into
Conversation
Jimbo4350
requested review from
carbolymer,
disassembler,
kevinhammond,
newhoggy and
palas
as code owners
September 1, 2026 15:07
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a regression where cardano-cli ... query kes-period-info can hang indefinitely by avoiding a second node connection (chain-sync) while a local-state-query mux connection is still active, and instead deriving the ChainTip from local-state queries.
Changes:
- Replace
getLocalChainTipusage inrunQueryKesPeriodInfoCmdwithqueryChainBlockNo/queryChainPointandmakeChainTip. - Add a changelog fragment documenting the bugfix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| cardano-cli/src/Cardano/CLI/EraBased/Query/Run.hs | Switch KES-period-info tip acquisition to local-state queries to prevent the mux deadlock. |
| .changes/20260901_fix_kes_period_info_hang.yml | Add release note entry for the hang fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+384
to
+386
| mChainBlockNo <- lift queryChainBlockNo & onLeft (left . QueryCmdUnsupportedNtcVersion) | ||
| mChainPoint <- lift queryChainPoint & onLeft (left . QueryCmdUnsupportedNtcVersion) | ||
| let chainTip = makeChainTip mChainBlockNo mChainPoint |
Comment on lines
+1
to
+2
| project: cardano-cli | ||
| pr: 0 |
Comment on lines
+384
to
+386
| mChainBlockNo <- lift queryChainBlockNo & onLeft (left . QueryCmdUnsupportedNtcVersion) | ||
| mChainPoint <- lift queryChainPoint & onLeft (left . QueryCmdUnsupportedNtcVersion) | ||
| let chainTip = makeChainTip mChainBlockNo mChainPoint |
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
Jimbo4350
force-pushed
the
fix/kes-period-info-hang
branch
from
September 1, 2026 15:42
53511a5 to
7b12808
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduced in 2cccfb8,
runQueryKesPeriodInfoCmdwas refactored to use theCIOmonad. In doing so,getLocalChainTipended up being called inside the local state query session rather than after it closed.getLocalChainTipworks by opening a fresh connection to the node. Opening a second connection while the first is still mid-query causes both connections to wait on each other indefinitely — the CLI hangs and never returns.Fix: replace
getLocalChainTipwithqueryChainBlockNo/queryChainPoint, which retrieve the same information through the already-open state query session. This is the same approach used byrunQueryTipCmd.Closes #1434
Changelog