This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
Add locks for pinning #2103
Labels
exp/wizard
Extensive knowledge (implications, ramifications) required
kind/bug
A bug in existing code (including security flaws)
kind/resolved-in-helia
P1
High: Likely tackled by core team if no one steps up
status/ready
Ready to be worked
Currently there is no locking mechanism when modifying pins.
We should take a lock when performing any kind of pin operation, in order to prevent simultaneous pin operations from interfering with each other.
For example when adding a pin, we
Without locking, any of these asynchronous operations may occur concurrently and cause out-of-date or incomplete pin sets to to be stored.
The pin operations are currently managed in
I believe changes will only need to be made in pin.js, however the Garbage Collection PR includes some refactoring such that this structure will change somewhat, so I would suggest implementing a fix for this issue after the GC PR has landed.
We can refer to the go implementation of pinning for inspiration.
The text was updated successfully, but these errors were encountered: