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

Connection's reconnect is asynchronous #721

Merged

Conversation

bchamagne
Copy link
Member

Description

Reconnect workflow used to be synchronous, which meant all incoming messages were queued to be processed later, and the callers had to wait until eventually they receive a :timeout.

This PR changed the reconnect workflow to be asynchronous, so the callers can get a :closed error message without delay.

NOTE: the first connection is still asynchronous to be able to keep existing code.

Fixes #710

Type of change

  • Bug fix

How Has This Been Tested?

Case added to the unit tests

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@samuelmanzanera samuelmanzanera added core team Assigned to the core team networking Involve networking enhancements labels Nov 29, 2022
lib/archethic/p2p/client/connection.ex Outdated Show resolved Hide resolved
lib/archethic/p2p/client/connection.ex Outdated Show resolved Hide resolved
test/archethic/p2p/client/connection_test.exs Show resolved Hide resolved
@bchamagne bchamagne requested a review from Neylix December 1, 2022 08:49
lib/archethic/p2p/client/connection.ex Outdated Show resolved Hide resolved
lib/archethic/p2p/client/connection.ex Outdated Show resolved Hide resolved
@samuelmanzanera samuelmanzanera merged commit 58ec61e into archethic-foundation:develop Dec 2, 2022
tenmoves pushed a commit to tenmoves/archethic-node that referenced this pull request Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core team Assigned to the core team enhancements networking Involve networking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use asynchronous connection
3 participants