-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Part 5|*] Thread Contexts through payment methods Part 1 #10307
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
[Part 5|*] Thread Contexts through payment methods Part 1 #10307
Conversation
283469a to
bc81c3a
Compare
bc81c3a to
7e6cabd
Compare
e991cd0 to
6860702
Compare
a5be3ed to
d76ffcd
Compare
ellemouton
left a comment
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.
nice! quick question
| // The context is already cancelled at this point, so we create | ||
| // a new context so the payment can successfully be marked as | ||
| // failed. | ||
| cleanupCtx := context.WithoutCancel(ctx) |
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.
hm - i wonder if we should make it a timeout context so we dont let it run forever?
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.
Yes I want this to securly commit to the db without any timeout, if something is wrong with the db it will be shown here. I mean in case the db connection flakes, this call will nonetheless return an error. Introducing like a context with a random timeout felt not good design but open to change it if yy things its better to have a timeout call.
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.
At this point i think it's easier to merge this PR and then address this question in a new PR, as most part of the PR is just passing the ctx, would be nice to merge first.
47606dd to
01d9986
Compare
3f22326 to
86ebeb7
Compare
86ebeb7 to
736f645
Compare
yyforyongyu
left a comment
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 🚢
| // The context is already cancelled at this point, so we create | ||
| // a new context so the payment can successfully be marked as | ||
| // failed. | ||
| cleanupCtx := context.WithoutCancel(ctx) |
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.
At this point i think it's easier to merge this PR and then address this question in a new PR, as most part of the PR is just passing the ctx, would be nice to merge first.
fcd4345
into
lightningnetwork:elle-payment-sql-series-new
Builds on top of the latest payment SQL changes and threads the context through payment functions.
This is part 1 threads the context up to the Router Level. We can even further thread the context up to the rpc level, however we need to be careful which functions we allow to be canceled by the RPC level. But this is tackled in Part 2.