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

ipfs add fails when routing partner goes offline #418

Closed
btc opened this issue Dec 8, 2014 · 11 comments
Closed

ipfs add fails when routing partner goes offline #418

btc opened this issue Dec 8, 2014 · 11 comments
Labels
kind/bug A bug in existing code (including security flaws)
Milestone

Comments

@btc
Copy link
Contributor

btc commented Dec 8, 2014

repro:

  1. with daemon running, add large file
  2. local daemon will provide keys to the network. observe the ID of the peer that receives these keys
  3. kill the remote peer
  4. add command hangs and fails
@btc btc added the kind/bug A bug in existing code (including security flaws) label Dec 8, 2014
@whyrusleeping
Copy link
Member

This is interesting... mostly likely because that peer doesnt get removed in our local routing table.

@btc
Copy link
Contributor Author

btc commented Dec 8, 2014

a) Do we need the swarm/network/service to call up to the client letting it know about the disconnection?

b) Or should the client discover the disconnection/unreachability when the client attempts to send a message out over the service?

With (a), there is a TOCTOU concern. With (b), it's kind of an awkward interface.

@jbenet
Copy link
Member

jbenet commented Dec 8, 2014

I agree b) is awkward. (which is why just sending messages is weird. we don't live in a world with constant connectivity yet).

I think TRTTD is a).

This is where we really should have events (pub/sub (or NSNotificationCenter) style).

  1. routing table adds peer p. subscribes to connection events on the network. something like net.NotificationSubscribe(p, handler)
  2. p goes offline.
  3. singleConn discovers this. closes. only open connection, MultiConn closes. Swarm closes it. announces that event. (notifications here could be in the swarm or directly in the Network).
  4. routing table receives event, and evicts p.

Not sure this is the easiest route to go here, given it introduces a whole new way of passing information around that's not there presently. But it may not be too bad.

I think we should eventually have a notification center (per node) abstraction.

@btc btc self-assigned this Dec 8, 2014
@btc btc added this to the α milestone Dec 8, 2014
@btc
Copy link
Contributor Author

btc commented Dec 8, 2014

I'll fix this issue using a system-wide notification center or pubsub.

It won't be feature rich, but it'll be a foundation cognizant of broader constraints.

@jbenet
Copy link
Member

jbenet commented Dec 8, 2014

@maybebtc add it to the IpfsNode, and either hand it down in the context, or add it to the major subsystems that need it.

@btc
Copy link
Contributor Author

btc commented Dec 8, 2014

SGTM

@jbenet
Copy link
Member

jbenet commented Jan 15, 2015

@briantigerchow this is still a problem eh?

@btc
Copy link
Contributor Author

btc commented Jan 15, 2015

Don't know for sure. Probably.

Needs a test.

  1. Construct two cores and bootstrap them
  2. Add/Cat
  3. Break the mock net link midway through.
  4. Ensure the Add was successful by attempting to Cat locally.

I suppose we want routing, bitswap, blockservice, etc. to respond wisely to the network errors that occur.

@jbenet
Copy link
Member

jbenet commented Jan 16, 2015

Absolutely. That sounds good to me.

@btc
Copy link
Contributor Author

btc commented Jan 16, 2015

I'll DRI this one.

@btc
Copy link
Contributor Author

btc commented Jan 22, 2015

fixed in #424

@btc btc closed this as completed Jan 22, 2015
@btc btc removed their assignment Mar 30, 2015
ariescodescream pushed a commit to ariescodescream/go-ipfs that referenced this issue Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

3 participants