Performance improvements after 2.0

Abierto
#449 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
58/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
google-cloud, python
Área
api, backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
Python
Estrellas
671
Forks
76
Merge medio
17 h 55 min
PR fusionados (30 d)
46

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de iterative/PyDrive2

Todos los issues de iterative/PyDrive2

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.