Conversation
Coverage Report for CI Build 24364263264Coverage increased (+0.02%) to 84.36%Details
Uncovered Changes
Coverage Regressions2 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
arminsabouri
left a comment
There was a problem hiding this comment.
CAck cf8b0b7
big pickle? Cool.
Should we / do we already ensure that there is > 2 ohttp relays ?
|
This PR also includes the commit from #1390, is it meant to supersede that PR? I left a comment there that I think we should address holistically (i.e. is ohttp_keys "cache" config field relevant at all since we refetch every time anyways?) |
|
I should add blocked as this simply builds on top of #1390 This PR would have simply needed to also add the commit from #1390 as the ohttp_keys have been "cached" by that point so relay selection is skipped and resume would just choose |
cf8b0b7 to
5062488
Compare
bc1cindy
left a comment
There was a problem hiding this comment.
tACK 5062488
minimal fix, each resumed session gets a fresh RelayManager, isolating relay state between sessions
but I think removing state from RelayManager and moving randomization into the struct as a method could simplify the design further, as commented in #1385 (comment)
|
Reviewed the fix, giving each resumed session a fresh
|
payjoin-cli/src/app/v2/mod.rs
Outdated
| let mut app = self_clone; | ||
| app.relay_manager = Arc::new(Mutex::new(RelayManager::new())); |
There was a problem hiding this comment.
This seems a bit off to me. Can add a getter to god app struct which randomizes which relay is use instead of cloning the app and mutating?
Maybe as simple as:
pub(crate) fn relay_manager (&self) -> RelayManager {
RelayManager::new()
}
Thanks for resurfacing that. Would a warning string be enough? Eitherway would like to get this PR through. This can be follow up work |
5062488 to
582259e
Compare
| &self, | ||
| sender: Sender<WithReplyKey>, | ||
| persister: &SenderPersister, | ||
| relay_manager: &mut RelayManager, |
There was a problem hiding this comment.
Why do we need to pass a mut reference if we can get a relay manager from self.relay_manager() ?
Not requesting a change, just a question
There was a problem hiding this comment.
No you're right the current behavior would I think just return back to caching the relay when it finds one that works during any long polling No actually I think I am getting mixed up, I'm jumping ahead towards per-request logic. I don't think the logic fundamentally changes though I think its unnecessary to bubble it up to these calls instead of right before unwrap_ohttp_keys_or_else_fetch
e107a16 to
4d81549
Compare
This commit ensures that each resumed payjoin-cli session is using a separate instance of the RelayManager to then check the ohttp connection independently. This fixes a bug where resuming would converge all existing sessions to one ohttp relay.
4d81549 to
d06ba2e
Compare
Closes #1391
This commit ensures that each resumed payjoin-cli session is using a
separate instance of the RelayManager to then check the ohttp connection
independently. This fixes a bug where resuming would converge all
existing sessions to one ohttp relay.
Also, the incompatible_msrv allow seems not needed anymore?
Big pickle wrote most of this code. The free open weight models aren't too shabby now either. Though it did want to recreate the entire config instead of just making the app mutable. I thought this seemed a bit easier to parse as its clear everything else is the same.
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.