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

Handle dial AlreadyConnected error via retries or state modification #225

Open
lexnv opened this issue Aug 30, 2024 · 0 comments
Open

Handle dial AlreadyConnected error via retries or state modification #225

lexnv opened this issue Aug 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@lexnv
Copy link
Collaborator

lexnv commented Aug 30, 2024

Because of the async nature of our code, it is entirely possible that:

  • we try to dial a peer that is already connected
  • the dialing happens before a ConnectionEstablished event is received

At the moment, this is affecting the request-response and notification protocols.
Instead of returning an immediate error, try to cache the request or state of negotiation and submit it when the connection is reported via events.

Code examples:

DialOptions::Dial => match self.service.dial(&peer) {

match self.service.dial(&peer) {

Discovered during: #222

@lexnv lexnv added the enhancement New feature or request label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant