Go-ipfs: Pin lock UI feedback

Created on 20 Mar 2017  路  5Comments  路  Source: ipfs/go-ipfs

Version information: 0.4.7

Type: enhancement

Priority: P2

Description:

Pinning operations take the pin lock, so that only one pinning operation can run at a time. When running ipfs pin add and another operation is currently running, it'll sit and wait until it acquires the lock and only then start to run. During this time there's no UI feedback.

Instead it should show something like "Waiting for other pin operations to finish... ok".

I think apart from ipfs pin add, this also applies to ipfs pin rm and ipfs add.

dieasy help wanted topicommands topirepo

Most helpful comment

@schomatis thank you. Let me take for a s"pin". 馃憤

All 5 comments

@lgierth Yeah, that would be nice. Currently we have no way of knowing that the lock is already taken, it just hangs as we try to acquire it. We should change that up a bit so we can do this

Beginner here. Would love to try this one out. Could some one please point me to the starting point. The IPFS code base is pretty large... @lgierth @whyrusleeping. Thank you.

Hey @biosckon, thanks for the help! The ipfs pin add command is in

https://github.com/ipfs/go-ipfs/blob/fcc96a3ae7c4ce45313cdc481d2b76d297ccb66f/core/commands/pin.go#L64-L82

If you follow the corerepo.Pin() call it will take you to the actual pin operation that acquires the lock in

https://github.com/ipfs/go-ipfs/blob/fcc96a3ae7c4ce45313cdc481d2b76d297ccb66f/pin/pin.go#L212-L215

With that said, bear in mind that there's no primitive to check if the lock is acquired (see 1, 2) and it doesn't seem like a trivial task to implement (at least to me that I'm new to Go) but if you already have enough experience with Go and feel confident about it go right ahead, if not, we have other issues you could tackle. Ping me if you have any questions.

@schomatis thank you. Let me take for a s"pin". 馃憤

We no longer take the pin lock while fetching data. Instead, we only hold it when modifying the pinning datastructures.

We _do_ take the GC (read) lock but that's a different issue.

Was this page helpful?
0 / 5 - 0 ratings