python / python/cpython

Fix portability of `sendfile(2)` support detection for Lustre filesystems

Aperta
#139,416 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

3.13 3.14 3.15 stdlib type-bug
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

Bug report

Bug description:

On Lustre on Linux (specifically the AWS implementation) there is a rare and difficult to reproduce failure of shutil.copyfile in its sendfile(2) fast path because the syscall returns ENODATA. The situation is recoverable by falling back to the standard read/write file copy (patch forthcoming).

Reproducing the bug requires the filesystem to be in a specific state which I have not been able to reproduce at will but we've seen it on occasions by multiple users. Additionally similar bug has been seen on rust fs::copy which similarly does not trap the ENODATA error.

Following is sufficient to reproduce bug for the specific (rare) file that fails:

import shutil
shutil.copyfile('src', 'dst')

error:

sent = os.sendfile(outfd, infd, offset, blocksize)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 61] No data available: '/shared/fsx1/filename' 
CPython versions tested on:

3.14

Operating systems tested on:

Linux

Linked PRs
  • gh-139417

Guida per i contributori

Apri la 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.

Direzione di ricerca

Inizia dal percorso rapido sendfile di shutil.copyfile e verifica come vengono gestiti gli errori di os.sendfile. Riproduci il fallimento con shutil.copyfile('src', 'dst') sul filesystem interessato; il lavoro è completato quando un errore ENODATA ricade nel percorso di copia standard in lettura/scrittura.

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

Valutazione

Stack tecnologico
linux, python
Ambito
operating-systems
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.