kubo/core/commands
Jorropo bb020ea1ef fix: deadlock while racing ipfs dag import and ipfs repo gc
This fixes a deadlock introduced in 1457b4fd4a.

We can't use the coreapi here because it will try to take the PinLock (RLock) again, so revert this small part of 1457b4fd4a.

This used cause a deadlock when concurrently running `ipfs dag import` concurrently with the GC.

The bug is that `ipfs dag import` takes an RLock with the PinLock.
*the cars are imported, leaving a wide window of time*
Then GC Takes a Lock on that same RWMutex while taking the GC Lock (it  blocks because it waits for the RLock to be released).
Then the car imports are finished and `ipfs dag import` tries to aqcuire the PinLock (doing an RLock) again in `Api().Pin`.

However at this point the RWMutex is starved, the runtime put a fence in front of RLocks if a Lock has been waiting for too lock (else you could have an endless stream of RLock / RUnlock forever delaying a Lock to ever go through).

The issue is that `ipfs dag import`'s original RLock which is blocking everyone will be released once it returns, which only happens when `Api().Pin` completes.

So we have a deadlock (ABA kind ?), because `ipfs dag import` waits on the GC Lock, which waits on `ipfs dag import`.

Calling the Pinner directly does not acquire the PinLock again, and thus does not have this issue.
2023-03-26 05:40:18 +02:00
..
cmdenv chore: migrate from go-ipfs-files to go-libipfs/files (#9535) 2023-01-13 14:27:03 +01:00
cmdutils refactor: rename to kubo 2022-07-06 18:40:37 +02:00
dag fix: deadlock while racing ipfs dag import and ipfs repo gc 2023-03-26 05:40:18 +02:00
e Fix typo in an error.go comment: "is adds" -> "adds". 2018-01-17 15:25:54 -08:00
keyencode chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
name fix: --verify forgets the verified key 2023-03-13 09:54:10 -04:00
object fix: handle new ProtoNode errors 2022-12-02 10:16:10 +11:00
pin docs: pin remote arg 2022-10-14 21:16:36 +02:00
unixfs refactor: rename to kubo 2022-07-06 18:40:37 +02:00
active.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
add.go chore: migrate from go-ipfs-files to go-libipfs/files (#9535) 2023-01-13 14:27:03 +01:00
bitswap.go feat(gateway): error handling improvements (500, 502, 504) (#9660) 2023-02-28 02:21:50 +01:00
block.go chore: migrate from go-ipfs-files to go-libipfs/files (#9535) 2023-01-13 14:27:03 +01:00
bootstrap.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
cat.go chore: migrate from go-ipfs-files to go-libipfs/files (#9535) 2023-01-13 14:27:03 +01:00
cid.go ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
commands_test.go feat: Reduce RM code footprint 2023-03-06 12:46:58 +01:00
commands.go feat: Add command line completion for fish 2022-10-30 21:13:53 +00:00
completion.go feat: Add command line completion for fish 2022-10-30 21:13:53 +00:00
config_test.go add remote pinning policy for mfs (#7798) 2021-01-28 18:58:44 -05:00
config.go fmt: applies go1.19 fmt 2022-09-08 18:34:06 +02:00
dht_test.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
dht.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
diag.go feat: add an "ipfs diag profile" command 2021-07-21 14:51:47 -07:00
dns.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
external.go refactor: get rid of cmdDetails awkwardness 2020-08-04 18:28:40 -04:00
extra.go refactor: get rid of cmdDetails awkwardness 2020-08-04 18:28:40 -04:00
files.go fix: handle new ProtoNode errors 2022-12-02 10:16:10 +11:00
filestore.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
get_test.go cmdkit -> cmds 2019-05-10 23:00:20 -07:00
get.go chore: migrate from go-ipfs-files to go-libipfs/files (#9535) 2023-01-13 14:27:03 +01:00
helptext_test.go gx: unrewrite 2019-03-05 18:33:56 +01:00
id.go chore: update go-libp2p to v0.25.1 2023-02-14 22:19:46 +01:00
keystore.go ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
log.go docs: note log tail is broken (#9383) 2022-11-10 00:20:53 +01:00
ls.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
mount_nofuse.go chore: mark fuse experimental (#8962) 2022-05-12 10:32:54 -07:00
mount_unix.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
mount_windows.go cmdkit -> cmds 2019-05-10 23:00:20 -07:00
multibase.go ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
p2p.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
ping.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
profile.go feat: add heap allocs to 'ipfs diag profile' 2023-03-17 10:09:33 -04:00
pubsub.go chore: deprecate the pubsub api 2023-03-15 04:42:02 +01:00
refs.go docs(cmds): Clarify block fetching of refs endpoint. 2022-10-13 17:29:29 +02:00
repo.go add refs local alias repo ls (#9320) 2022-10-13 17:30:19 +02:00
resolve.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
root_test.go pre-populate required arguments from request body 2018-03-18 13:04:25 -07:00
root.go ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
routing.go fix: restore wire format for /api/v0/routing/get|put (#9639) 2023-02-10 02:41:45 +01:00
shutdown.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
stat_dht.go chore: bump go-libp2p v0.22.0 & go1.18&go1.19 2022-09-09 17:09:38 +02:00
stat_provide.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
stat.go ci: add stylecheck to golangci-lint (#9334) 2022-10-06 10:18:40 -04:00
swarm.go feat: Reduce RM code footprint 2023-03-06 12:46:58 +01:00
sysdiag.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
tar.go refactor: rename to kubo 2022-07-06 18:40:37 +02:00
urlstore.go chore: migrate from go-ipfs-files to go-libipfs/files (#9535) 2023-01-13 14:27:03 +01:00
version.go fix: kubo in daemon and cli stdout 2022-07-20 16:26:49 +02:00