Document importing should a minimal amount of work if the document already exists

Aperta
#63 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust

Direzione di ricerca

Inizia confrontando il comportamento di iroh.docs.open e iroh.docs.import, usando come contesto lo scenario di importazioni ripetute e iroh issue 1947. Verifica come vengono gestiti i documenti esistenti e gli indirizzi dei nodi dei ticket. Il lavoro è completato quando le importazioni ripetute restituiscono il controllo prontamente come open, continuando comunque a integrare in background i nuovi indirizzi dei nodi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

This is sort-of the document equivalent of https://github.com/n0-computer/iroh/issues/1947. If RPC calls to import the same document are made in quick succession (as happens with https://github.com/expenses/usd-iroh-resolver), the RPC calls will eventually stall out (unless a timeout is used) and the iroh node will produce a bunch of sync and gossip warnings:

2024-02-02T03:44:28.897392Z  WARN gossip{me=5edsipymvbm2kl2y}: iroh_gossip::net: dial failed: failed connecting to provider peer=PublicKey(7siesmyj2xdrlsti)
2024-02-02T03:44:28.897519Z  WARN sync{me=5edsipymvbm2kl2y}: iroh::sync_engine::live: sync failed origin=Connect(DirectJoin) err=Failed to establish connection

Caused by:
    0: failed connecting to provider
    1: timed out

I managed to work around whatever issue is happening with iroh by checking if the document to import exists locally first:

if let Some(doc) = iroh.docs.open(ticket.capability.id()).await? {
    return Ok(doc);
}

iroh.docs.import(ticket.clone()).await

This will not produce the expected behaviour if the ticket contains the addresses of nodes that aren't currently being synced with, as these will not be sent to the iroh node.

Ideally iroh.docs.import should perform the same actions as iroh.docs.open if the document already exists and there are no new node addresses, and if there are new nodes, should join these in the background while returning the document the same was as iroh.docs.open.

Lingua principale
Rust
Stelle
81
Fork
19
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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di n0-computer/iroh-docs

Tutte le issue di n0-computer/iroh-docs

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.