Performance improvements after 2.0

Ouverte
#449 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
58/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
google-cloud, python
Domaine
api, backend

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
Python
Étoiles
671
Forks
76
Merge moyen
17 h 55 min
PR mergées (30 j)
46

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de iterative/PyDrive2

Toutes les issues de iterative/PyDrive2

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.