Avoid writing tests which will hang indefinitely on failure conditions.
Introduce TODOs.
Rename some vars to more explicit names.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
This creates a race condition where the items may have been
already pinned before the operation is registered in the tracker.
This may result in operations being left in the tracker and potentially
never completed.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
come off the pin/unpin channels.
Also fix a race condition in the operationTracker.
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
to the ipfscluster.IPFSConnector interface and then
to the implementation of that interface in ipfsconn/ipfshttp.
This allows calls from MapPinTracker to cancel requests made
to the local IPFS node.
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
The TrackerStatuses were starting to be used to convey the inflight
status of an 'operation', instead of just the status of the Pin.
I have separated out any thing related to 'operations' and
an operation's 'phases'.
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
ipfshttp: cancel POST request when timeout reached
ipfshttp/config: fix config test
ipfshttp: use struct styling for multi-line func calls
ipfshttp/config: add general ClientTimeout
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
query args correctly, requiring both a trailing slash and
non-trailing slash handle pattern to be defined for the
pin and unpin handlers.
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
The extractCid function was added to enable the extraction of
a cid argument from either the url path or query string.
This puts the proxy behaviour on par with the current IPFS API.
The function does rely on the fact that ipfs-cluster doesn't
intercept any command that has more than one subcommand.
If that changes, this function will have to be updated.
License: MIT
Signed-off-by: Adrian Lanzafame <adrianlanzafame92@gmail.com>
This uses the PeerAdd endpoint which should NOT be used as the current
workflow states that the way to adding peers is bootstrapping.
Adding peers manually with this endpoint leads to split-head states very
easily. The fact that this operation is visible in ipfs-cluster-ctl
is only leading the users to bad places.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
`basic_auth_credentials` in `api` part of the config accepts a map, with username as key and password as value.
License: MIT
Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
* Test case creates a bunch of clusters, assigns a pin with replica factor
of n-1 to them, and removes one of the peers randomly. It then tests
to check that the number of clusters pinning the cid is n-2.
* Add warn log to let user know that due to disable_repinning option,
the cluster won't attempt to re-assign the pin.
License: MIT
Signed-off-by: Sina Mahmoodi <itz.s1na@gmail.com>
It should provide a way to speed up peer list updates when
peers join/part. It was hardcoded.
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>