Difficult to use one session per request (e.g. gateway request)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- go
- Ambito
- backend, distributed-systems
Direzione di ricerca
Inizia leggendo le alternative in boxo#563, boxo#561, kubo#7198 e #549, quindi esamina come sono descritti nell’issue i creatori di sessioni, i consumer e i livelli intermediari. Il lavoro è completato quando viene selezionata e documentata una direzione concreta per preservare una sessione logica per richiesta, affrontando al contempo la pulizia e le interazioni con blockservice-wrapper.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Background
The point of data transfer sessions is to handle the logic around discovering peers that might have the data you need and which peers to ask for which subset of the data. It does this by making assumptions/guesses around the association of various requests (i.e. these 10 block requests are all associated with the same HTTP gateway request). Historically getting the plumbing right here to actually have one session in code per logical session has been a pain resulting in multiple sessions being created within single requests (e.g. gateway requests).
On top of this long standing issue we're also seeing some issues with blockservice wrappers not working nicely with sessions https://github.com/ipfs-shipyard/nopfs/issues/34 due to how the abstraction layers are entangled.
Options
There have been a few recent and older proposals, most of them involve embedding session information in the context (e.g. https://github.com/ipfs/kubo/issues/7198, #549 although it's incomplete on it's own).
Some of the concrete approaches some of them (along with a brief description) are:
- https://github.com/ipfs/boxo/pull/563 -> Put the concept of sessions in the blockservice interface
- https://github.com/ipfs/boxo/pull/561 -> Remove the abstraction of a blockservice interface and whenever someone needs more functionality it means more options passed into the boxo.BlockService struct's constructor
- https://github.com/ipfs/kubo/issues/7198 -> Make the concept of sessions global, but basically just a uint64, individual layers of the stack (e.g. bitswap or something higher level if that emerges) can then choose to locally associate state with
- Do nothing (pre #549) -> Make the user create a shallow clone of the stack of components for every session
Analysis
- Doing nothing/asking the user to create one "stack" per request isn't working
- #561 is less flexible than #563
The main difference between #561 and https://github.com/ipfs/kubo/issues/7198 is a tradeoff between cleanup complexity and adding more propagation of sessions everywhere.
- #563
- When the context gets cleaned up by Go's GC the session object will get cleaned up as well
- Sessions need to be handled by: Session consumers (e.g. bitswap), Session creators (e.g. gateway), everything in between (e.g. boxo.blockservice, nopfs, dagservice, fetcher, etc.)
- https://github.com/ipfs/kubo/issues/7198
- Needs to manually manage and synchronise state (
uint64→*session) in all session consumers - A goroutine would need to get spun up to handle cleanup on context cancellation.
- Could be a long lived one (as is currently the case in the bitswap implementation) or a short lived one via https://pkg.go.dev/context#AfterFunc
- Sessions need to be handled by: Session consumers (e.g. bitswap), Session creators (e.g. gateway)
- Needs to manually manage and synchronise state (
Let's decide which change to make going forward.
- Lingua principale
- Go
- Stelle
- 326
- Fork
- 165
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ipfs/boxo
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 46/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
need/triage
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
-
dif/medium effort/hours kind/enhancement P3 topic/devexp
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Issue simili
-
affects-8.5 component/session severity/moderate sig/transaction type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
harvester/harvester#12311 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
verifyrun --bracket-digest --credit: relative --witness is could-not-check, absolute path creditsApertabug effort:s impact:low raised-by:desk risk:low
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
medici-finance/assay#6580 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
blinklabs-io/gouroboros#3026 ·
I maintainer di solito rispondono entro 1 giorno