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

Pin with ton of hashes won't start #4122

Closed
ghost opened this issue Aug 5, 2017 · 14 comments
Closed

Pin with ton of hashes won't start #4122

ghost opened this issue Aug 5, 2017 · 14 comments
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP topic/commands Topic commands

Comments

@ghost
Copy link

ghost commented Aug 5, 2017

Version information: go-ipfs/0.4.10/4679f80

Type: bug

Severity: High

Description:

ipfs pin add with a ton of hashes as input won't start doing anything. It'll just sit there, even with --progress it'll never move beyond `Fetched/Processed 0 nodes.

This applies to both cat hashes.txt | xargs ipfs pin add, as well as cat hashes.txt | ipfs pin add.

The list in question has 1199 items: pins.txt.

@ghost ghost added kind/bug A bug in existing code (including security flaws) topic/commands Topic commands help wanted Seeking public contribution on this issue labels Aug 5, 2017
@whyrusleeping
Copy link
Member

Interesting, we should look at what is holding it up. Does pinning just two hashes at a time work? I would be interested to see something like:

for i in `seq 2 1000`
do
    date
    echo $i hashes
    head -n$i hashes.txt | ipfs pin add 
done

@whyrusleeping whyrusleeping added this to the Ipfs 0.4.12 milestone Aug 29, 2017
@Stebalien Stebalien changed the title Pin with ton of hahes won't start Pin with ton of hashes won't start Oct 5, 2017
@Stebalien
Copy link
Member

This appears to be doing a lot of dialing.

@Stebalien
Copy link
Member

Yeah, this looks like a dialing issue. I'm guessing it's a combination of:

  1. Dial timeouts.
  2. Dial backoffs.
  3. Dial limits.

That is, we're queuing up enough dials such that, by the time we start processing each dial, it has already expired.


Using bitswap sessions for pin will significantly help but that's not a real fix. We should probably avoid infinitely queuing dials (have a finite dial queue and immediately reject or block all other dial requests).

@whyrusleeping whyrusleeping added P0 Critical: Tackled by core team ASAP status/ready Ready to be worked labels Oct 17, 2017
@Kubuxu Kubuxu modified the milestones: Ipfs 0.4.12, go-ipfs 0.4.13 Nov 6, 2017
@leerspace
Copy link
Contributor

If anyone comes across this issue and wants a one-liner workaround, try cat hashes.txt | xargs -L 1 ipfs pin add. It's the same as the command in the first post which doesn't work, except it uses the -L 1 argument for xargs to force only one pin to be added at a time.

@ligi
Copy link

ligi commented Nov 18, 2017

was this one solved with 0.4.13 and just forgotten to close? Unfortunately the workaround does not really work for me and I am stumbling into this one often with my kontinuum ci

@whyrusleeping
Copy link
Member

@ligi how many hashes are you pinning at the same time?

@whyrusleeping
Copy link
Member

@ligi also, is this with or without the progress feature?

@ligi
Copy link

ligi commented Nov 18, 2017

@whyrusleeping no I do not use the progress feature - usure about the amount of hashes - I just try to pin my reports ..-)

@whyrusleeping
Copy link
Member

whyrusleeping commented Nov 18, 2017

I wonder if this is related to the pinning issue that @hsanjuan brought up recently.

@ligi when this happens, could you grab me a full stack trace of the daemon? (via curl localhost:5001/debug/pprof/goroutine\?debug=2)

@leerspace
Copy link
Contributor

@whyrusleeping I think there might be a typo in that debug command. Based on this debug documentation it's singular "goroutine" instead of plural. The one in your post returns Unknown profile: goroutines for me.

This is the one from the debug document that seems to work for me:

curl localhost:5001/debug/pprof/goroutine\?debug=2

@whyrusleeping
Copy link
Member

whyrusleeping commented Nov 19, 2017 via email

@hsanjuan
Copy link
Contributor

Yeah, some of my hanging tests are also pinning several things at the "same time" (sequentially but close in time) #4394

@hsanjuan
Copy link
Contributor

Actually, thinking about it it's the opposite, while we cluster-pin several things at the same time ipfs-cluster does not trigger 2 ipfs pin requests at the same time. We queue them and only trigger the new one when the previous one is finished.

@Stebalien
Copy link
Member

So, with #4403, this appears to work much better (secio/dialing change?). I now see my wantlist updating. However, IPFS appears to wait a while before actually pinning. Furthermore, it seems to start of very slowly, fetching each item on the list one-by-one in sequence (blocking until it finishes fetching each one).

Stebalien added a commit that referenced this issue Dec 4, 2017
instead of resolving all the pins first and then pinning, pin after resolving
each pin.

This:

1. Avoids storing all the nodes in memory.
2. Avoids not showing pin progress.

fixes #4122

License: MIT
Signed-off-by: Steven Allen <[email protected]>
@ghost ghost removed the status/ready Ready to be worked label Dec 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P0 Critical: Tackled by core team ASAP topic/commands Topic commands
Projects
None yet
Development

No branches or pull requests

6 participants