-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix: race condition on resizing #1742
Conversation
bca9266
to
90c8ac3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
// this should never happen because we are only loading `Open` and | ||
// `Resizing` a few lines above | ||
tracing::error!( | ||
channel_id = msg.channel_id.to_hex(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔧 the comment does not match the match statement.
CHANGELOG.md
Outdated
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
## [Unreleased] | |||
|
|||
- Feat: Receive USD-P via Lightning | |||
- Fix: a bug which may lead to a stuck position due to some async tasks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Instead of writing what it may fix, I would write what has changed. Like replaced a task with explicitly setting the closed state when the protocol finished.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we need to agree for whom the changelog is 😅
What you describe can be found in the commit message while here I'm writing high-level description only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would still be high level wouldn't it? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mhm, fair enough. I'll extend it and we all will be happy :D
a95d52d
to
2cbc7bc
Compare
By setting the position only to closed in our db when we receive the `CloseFinalize` event we can get rid of the async task `closed_positions` which checked regularly if a position needs to be closed in the db. This helps us to remove a race condition where a position was accidentally set to closed which was actually in resizing.
2cbc7bc
to
b38a2a2
Compare
By setting the position only to closed in our db when we receive the
CloseFinalize
event we can get rid of the async taskclosed_positions
which checked regularly if a position needs to be closed in the db. This helps us to remove a race condition where a position was accidentally set to closed which was actually in resizing.Resolves https://github.com/get10101/meta/issues/259
Resolves https://github.com/get10101/meta/issues/262
Replaces #1734