sociomantic-tsunami / swarm

Asynchronous client/node framework library
Boost Software License 1.0
14 stars 26 forks source link

Don't wait for the connection to be reestablished for single node requests #371

Closed nemanja-boric-sociomantic closed 5 years ago

nemanja-boric-sociomantic commented 5 years ago

In case when the connection was never established to the node, all single-node requests will fail, because the connection will not be found in the connection set. However, in case when the connection breaks during the lifetime of the client, the client will keep scheduling requests for the connection until the connection is reeastablished.

This change checks the connection status before starting the single-node request. In case the connection is not established, the client report the same error as if the connection was never established.

joseph-wakeling-sociomantic commented 5 years ago

I've tried this with the app where we spotted the hanging put requests, and it seems to work: where previously we saw DHT.neo Put requests just never completing (with the notifier never being callled), now we see those Put requests explicitly failing as expected.