Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/priority: refactor to fix deadlock #1429

Merged
merged 7 commits into from
Nov 11, 2022
Merged

Conversation

corverroos
Copy link
Contributor

@corverroos corverroos commented Nov 11, 2022

Refactor priority main processing goroutine to fix deadlock when own message is received after and before others.

category: bug
ticket: none

@codecov
Copy link

codecov bot commented Nov 11, 2022

Codecov Report

Base: 53.41% // Head: 53.47% // Increases project coverage by +0.05% 🎉

Coverage data is based on head (03b0381) compared to base (7ccca9b).
Patch coverage: 72.89% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1429      +/-   ##
==========================================
+ Coverage   53.41%   53.47%   +0.05%     
==========================================
  Files         145      147       +2     
  Lines       18193    18349     +156     
==========================================
+ Hits         9718     9812      +94     
- Misses       7140     7187      +47     
- Partials     1335     1350      +15     
Impacted Files Coverage Δ
core/priority/prioritiser.go 64.34% <72.52%> (-0.88%) ⬇️
app/vmock.go 74.09% <73.33%> (-3.04%) ⬇️
p2p/receive.go 54.28% <100.00%> (ø)
app/peerinfo/peerinfo.go 54.48% <0.00%> (-3.45%) ⬇️
core/qbft/qbft.go 81.51% <0.00%> (-0.85%) ⬇️
testutil/beaconmock/headproducer.go 52.84% <0.00%> (-0.82%) ⬇️
core/dutydb/memory.go 68.59% <0.00%> (-0.70%) ⬇️
app/log/loki/client.go 65.26% <0.00%> (ø)
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

recv.Response <- other.Msg

recv.Response <- own // Response channel has capacity of 1.
recv.Response = nil // Mark channel as responded..
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not close(recv.Response) to "Mark channel as responded"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored the whole thing, should be more obvious now.

@corverroos corverroos changed the title core/priority: fix deadlock core/priority: refactor to fix deadlock Nov 11, 2022
@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label Nov 11, 2022
@obol-bulldozer obol-bulldozer bot merged commit 22bdc3f into main Nov 11, 2022
@obol-bulldozer obol-bulldozer bot deleted the corver/priodeadlock branch November 11, 2022 12:35
obol-bulldozer bot pushed a commit that referenced this pull request Nov 14, 2022
Refactor priority protocol implementation:
 - Align with consensus component architecture
 - Change instance to duty for improve compatibility and logging and simplicity.
 - Control priority instance with single context, including consensus timeout.

category: refactor
ticket: #1429
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants