Skip to content

Handle multiple connections between two nodes#732

Merged
sgkim126 merged 1 commit intoCodeChain-io:masterfrom
hyunsikjeong:fix_discovery
Sep 21, 2018
Merged

Handle multiple connections between two nodes#732
sgkim126 merged 1 commit intoCodeChain-io:masterfrom
hyunsikjeong:fix_discovery

Conversation

@hyunsikjeong
Copy link
Copy Markdown
Contributor

@hyunsikjeong hyunsikjeong commented Sep 18, 2018

Fixing #724.

Two problems:

  1. A timer is not working even successfully set by io.register_timer_once(stream, random_interval).expect("Pull connections must be registered");
  2. Some processes do not die normally, but main TRACE shutdown [IoService] Closed. in every log.

@hyunsikjeong hyunsikjeong added bug Something isn't working network labels Sep 18, 2018
@hyunsikjeong hyunsikjeong force-pushed the fix_discovery branch 3 times, most recently from 13c069d to 79fa732 Compare September 19, 2018 09:29
@hyunsikjeong hyunsikjeong changed the title [WIP] Handle multiple connections between two nodes Handle multiple connections between two nodes Sep 19, 2018
@hyunsikjeong
Copy link
Copy Markdown
Contributor Author

Fixed. But I have no idea that why io.register_timer_once() is working well in finally().

@hyunsikjeong
Copy link
Copy Markdown
Contributor Author

Two states are added in the routing table: Establishing and WaitingReconnection.
If a node get a sync message from the opposite node while Establishing, it means there are multiple connections so the node will disconnect, change the state to WaitingReconnection, and wait reconnection for random duration between 2s~5s. (See MINIMUM_RECONNECTION_TIME and MAXIMUM_RECONNECTION_TIME)

@hyunsikjeong hyunsikjeong changed the title Handle multiple connections between two nodes [WIP] Handle multiple connections between two nodes Sep 19, 2018
@hyunsikjeong
Copy link
Copy Markdown
Contributor Author

Found an exception.

@hyunsikjeong hyunsikjeong changed the title [WIP] Handle multiple connections between two nodes Handle multiple connections between two nodes Sep 20, 2018
@hyunsikjeong
Copy link
Copy Markdown
Contributor Author

hyunsikjeong commented Sep 20, 2018

The new issues are added (#744, #745) and the discovery test still has problems, so not allowing the test in this patch. But the patch will resolve the issue #724.
@sgkim126

@hyunsikjeong hyunsikjeong force-pushed the fix_discovery branch 2 times, most recently from c78a0b9 to f61fe5b Compare September 20, 2018 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working network

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants