It happens in the discovery integration tests. You can reproduce the situation sometimes by running the tests.
If two nodes try to connect to each other at the same time, the routing table of each node set the other node to the establish state, by
if self.connections.connect(token, stream, local_node_id, session, socket_address, self.get_port()) {
self.routing_table.establish(socket_address);
Some(token)
}
Next, they sends Sync message to each other, and stuck. Also, you can find out an error message Cannot find session, because of the code below:
let session = self
.routing_table
.unestablished_session(&remote_addr)
.ok_or(Error::General("Cannot find session"))?;
Notice that it is already established in the routing table.
It happens in the discovery integration tests. You can reproduce the situation sometimes by running the tests.
If two nodes try to connect to each other at the same time, the routing table of each node set the other node to the
establishstate, byNext, they sends
Syncmessage to each other, and stuck. Also, you can find out an error messageCannot find session, because of the code below:Notice that it is already established in the routing table.