Skip to content

fix(blockstm): wake up suspended executors on cancel #25793

Merged
Eric-Warehime merged 13 commits intocosmos:mainfrom
mmsqe:add_cancel
Feb 10, 2026
Merged

fix(blockstm): wake up suspended executors on cancel #25793
Eric-Warehime merged 13 commits intocosmos:mainfrom
mmsqe:add_cancel

Conversation

@mmsqe
Copy link
Copy Markdown
Collaborator

@mmsqe mmsqe commented Jan 19, 2026

Description

to prevent goroutine leaks and hanging when scheduler doesn't complete

Closes: #25789

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 94.11765% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.59%. Comparing base (8a694f0) to head (53a4582).

Files with missing lines Patch % Lines
blockstm/mvmemory.go 50.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #25793      +/-   ##
==========================================
- Coverage   70.84%   68.59%   -2.25%     
==========================================
  Files         890      889       -1     
  Lines       58024    58017       -7     
==========================================
- Hits        41106    39797    -1309     
- Misses      16918    18220    +1302     
Files with missing lines Coverage Δ
blockstm/scheduler.go 92.85% <100.00%> (+0.46%) ⬆️
blockstm/status.go 100.00% <100.00%> (ø)
blockstm/stm.go 84.61% <100.00%> (+5.30%) ⬆️
blockstm/mvmemory.go 97.26% <50.00%> (-2.74%) ⬇️

... and 38 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread blockstm/status.go Outdated
Comment thread blockstm/status.go Outdated
Comment thread blockstm/stm.go Outdated
Comment thread blockstm/stm.go
Comment on lines +60 to +69
go func() {
select {
case <-ctx.Done():
canceled := scheduler.CancelAll()
for _, txn := range canceled {
mvMemory.ClearEstimates(txn)
}
case <-cancelDone:
}
}()

Check notice

Code scanning / CodeQL

Spawning a Go routine

Spawning a Go routine may be a possible source of non-determinism
Comment thread blockstm/txnrunner.go Outdated
Comment thread blockstm/stm.go Outdated
@Eric-Warehime Eric-Warehime added this pull request to the merge queue Feb 10, 2026
Merged via the queue into cosmos:main with commit c6909d5 Feb 10, 2026
42 of 43 checks passed
warpbuild-benchmark-bot Bot added a commit to WarpBuilds/cosmos-sdk that referenced this pull request Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

blockstm: need to cancel suspended executors when context is canceled

5 participants