Performance improvements after 2.0

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

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
google-cloud, python
Ambito
api, backend

Direzione di ricerca

Read GoogleDriveFile.Upload() and the filesystem retry path affected by #443. Compare the current upload flow with Drive’s resumable upload session guide, focusing on retaining the session and querying its received byte offset after a connection failure. Done means retries resume from that offset while retaining the pre-generated file ID; the issue gives a 256 MiB offline measurement for comparison.

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

Descrizione

Performance work deliberately left out of the 2.0 release. Each item works correctly today; it only costs more time, traffic or requests than it needs to.

Resume an interrupted upload instead of starting it again

Since #443 the filesystem repeats an upload whose connection fails, and a pre-generated file ID makes the repeat safe (no duplicate file). The repeat starts from the first byte, though:

fs.put_file("model.bin", "root/models/model.bin")  # 256 MiB

If the connection drops after 240 MiB, the filesystem sends the whole 256 MiB again, 496 MiB in total. Up to three repeats can send the file four times.

Drive keeps a resumable upload session after a dropped connection. The client can ask the session how many bytes Drive has received (an empty PUT with Content-Range: bytes */<size>) and continue from that offset (Drive guide). That needs the upload in GoogleDriveFile.Upload() to keep its session between chunks and expose the offset, and the filesystem retry to resume that session instead of calling Upload() again. The pre-generated ID stays, for a final answer that is lost.

Measured offline: a 256 MiB upload whose connection drops at 240 MiB sends 496 MiB across two sessions.

🤖 Generated with Claude Code

Lingua principale
Python
Stelle
671
Fork
76
Merge medio
17h 55m
PR unite (30g)
46

Preparare l'ambiente

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 iterative/PyDrive2

Tutte le issue di iterative/PyDrive2

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.