-
Notifications
You must be signed in to change notification settings - Fork 419
Restore debug assertion removed due to lockorder restrictions #3943
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
Restore debug assertion removed due to lockorder restrictions #3943
Conversation
I've assigned @jkczyz as a reviewer! |
6bf3be6
to
d5e20fb
Compare
4a71e77
to
f2d885a
Compare
In 4582b20 we removed a debug assertion which tested that channels seeing HTLC claim replays on startup would be properly unblocked by later monitor update completion in the downstream chanel. We did so because we couldn't pass our lockorder tests taking a `per_peer_state` read lock to check if a channel was closed while the a `per_peer_state` read lock was already held. However, there's no actual reason for that, its just an arbitrary restriction of our lockorder tests. Here we restore the removed debug assertion by simply enabling the skipping of lockorder checking in `#[cfg(test)]` code - we don't care if there's a theoretical deadlock in test-only code as long as none of our tests actually hit it. Note that we also take this opportunity to enable deadlock detection in `no-std` tests as even `#[cfg(not(feature = "std"))]` test builds allow access to `std`.
f2d885a
to
eadb70f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3943 +/- ##
==========================================
- Coverage 89.05% 89.03% -0.02%
==========================================
Files 167 167
Lines 121800 121847 +47
Branches 121800 121847 +47
==========================================
+ Hits 108464 108482 +18
- Misses 10928 10949 +21
- Partials 2408 2416 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
🔔 1st Reminder Hey @jkczyz! This PR has been waiting for your review. |
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
Landing as debug-builds-assertion-only. |
In 4582b20 we removed a debug assertion which tested that channels seeing HTLC claim replays on startup would be properly unblocked by later monitor update completion in the downstream chanel.
We did so because we couldn't pass our lockorder tests taking a
per_peer_state
read lock to check if a channel was closed while the aper_peer_state
read lock was already held.However, there's no actual reason for that, its just an arbitrary restriction of our lockorder tests.
Here we restore the removed debug assertion by simply enabling the skipping of lockorder checking in
#[cfg(test)]
code - we don't care if there's a theoretical deadlock in test-only code as long as none of our tests actually hit it.Note that we also take this opportunity to enable deadlock detection in
no-std
tests as even#[cfg(not(feature = "std"))]
test builds allow access tostd
.