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

add backoff to FederationPeer::request #5489

Closed
maan2003 opened this issue Jun 20, 2024 · 7 comments
Closed

add backoff to FederationPeer::request #5489

maan2003 opened this issue Jun 20, 2024 · 7 comments
Assignees

Comments

@maan2003
Copy link
Member

maan2003 commented Jun 20, 2024

pub async fn request(&self, method: &str, params: &[Value]) -> JsonRpcResult<Value> {

it is hammering the browser and crashed the app.

@tvolk131 tvolk131 self-assigned this Jun 24, 2024
@tvolk131
Copy link
Member

tvolk131 commented Jul 7, 2024

@maan2003 I tried to dig into this today but the link you put here isn't working - do you mind updating it?

@maan2003
Copy link
Member Author

maan2003 commented Jul 7, 2024

updated

there is no backoff in reconnect triggered by multiple concurrent requests to federation peer.

cc @dpc

@dpc
Copy link
Contributor

dpc commented Jul 8, 2024

@maan2003 I did a test. just devimint-env, then killall fedimintd, then I run env RUST_LOG=fm::client::net=debug fedimint-cli dev api status and see that timeouts are indeed increasing (thought I do see we need a fix).

there is no backoff in reconnect triggered by multiple concurrent requests to federation peer.

Hmm... I don't see how this could be happening. Multiple requests to FederationPeer<C>::request will synchronize on self.client.read() and self.client.write(), and trigger only one reconnect, then block and synchronize again on rclient.client.get_try().

So before I connect, can we confirm which version are we talking about here @maan2003 . These recent reconnection improvements are not part of 0.3.x and were unreleased yet.

Also, worth mentioning that reconnection tracking is part of a PeerClient<WsClient> and is not persisted anywhere. If the end application was somehow re-creating PeerClient<WsClient> it would keep getting reset.

@dpc
Copy link
Contributor

dpc commented Jul 8, 2024

Also, worth mentioning that reconnection tracking is part of a PeerClient<WsClient> and is not persisted anywhere. If the end application was somehow re-creating PeerClient<WsClient> it would keep getting reset.

Oh. I think I've found something.

@dpc
Copy link
Contributor

dpc commented Jul 8, 2024

Oh. I think I've found something.

Actually, #5587 is an improvement, but given it has backoff logic on its own, it shouldn't lead to hammering peers.

@dpc
Copy link
Contributor

dpc commented Jul 22, 2024

FYI. From my perspective everything looks good, after I've fixed the above issues. We had a call today where I showed more people what I looked at and why everything LGTM now.

Until there is more concrete details with latest code, I consider this fixed.

@maan2003
Copy link
Member Author

I am going to close this for now, will reopen if we hit this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants