sociomantic-tsunami / dlsproto

Distributed Log Store protocol definition, client, fake node, and tests
Boost Software License 1.0
3 stars 18 forks source link

Abort the request on the connection after the inactivity timeout #31

Closed nemanja-boric-sociomantic closed 6 years ago

nemanja-boric-sociomantic commented 6 years ago

If there's a bug in the node's implementation, or the routing error in the network, the node might not be able to proceed with sending the data to the client. Perhaps setting the inactivity timeout could abort the iteration on the given node, without user having to setup/maintain inactivity timer in their code (which is different than total-time timeout, as the timer needs to be reset each time we get data from the node).

gavin-norman-sociomantic commented 6 years ago

It would be pretty easy to implement this in user code, by storing the current time whenever the notifier provides a record. If the stored timestamp goes beyond a certain age, stop the request.

nemanja-boric-sociomantic commented 6 years ago

The only complication is that there should be a periodic task to check all of this. But I think that's simpler than a swarm/proto side of the implementation, given the internals. I will close this, and we can reopen if there's a better use-case.