Interrupted large file upload loses the interrupt flag and keeps uploading parts
Les mainteneurs répondent en général sous 3 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 55/100
Piste de recherche
Start with the two catch (InterruptedException e) blocks in core/src/main/java/com/backblaze/b2/client/B2LargeFileStorer.java, around lines 285-287 (storeFile) and 336-338 (storeParts), and follow the async chain in storeFileAsync around lines 304-312. Compare them with the handling at B2LargeFileUploader.java line 230, which restores the interrupt flag. Done means the interrupt flag is restored and pending part uploads are cancelled, checked by a test that interrupts a thread while a slow part storer is running.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
What happens
If the calling thread is interrupted while B2LargeFileStorer.storeFile() or storeParts() is waiting on the upload, the method throws a B2LocalException but does not call Thread.currentThread().interrupt() and does not cancel the part uploads. The caller is told the upload failed, while parts (and the final finish step chained to them) can keep running in the executor.
Where
core/src/main/java/com/backblaze/b2/client/B2LargeFileStorer.java:285-287 (storeFile) and :336-338 (storeParts), the catch (InterruptedException e) blocks; the chain that keeps running is storeFileAsync at about :304-312. For comparison, B2LargeFileUploader.java:229-231 does call Thread.currentThread().interrupt() in the same situation.
Why it matters
Impact: Wrong request or result (failure reported while work continues, and the interrupt flag is lost without any message). Severity: High, because it only happens when a thread is interrupted during a large upload (unusual), and there is no workaround: a caller cannot tell whether the file was later finished.
How to check
Found by reading the code, not reproduced. Read the two catch blocks and compare them with B2LargeFileUploader at line 230. A test could start storeFile with a slow part storer, interrupt the thread, and check Thread.currentThread().isInterrupted() and whether the part storers are still running.
Version
Seen at v6.5.0. Present on the default branch: present.
- Langage dominant
- Java
- Étoiles
- 103
- Forks
- 23
- Merge moyen
- 5 j 8 h
- PR mergées (30 j)
- 3
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de Backblaze/b2-sdk-java
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Backblaze/b2-sdk-java#248 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
Backblaze/b2-sdk-java#247 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Backblaze/b2-sdk-java#246 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Backblaze/b2-sdk-java#245 ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Backblaze/b2-sdk-java#242 ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de Backblaze/b2-sdk-java
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
IETF-Hackathon/pqc-certificates#351 ·
Les mainteneurs répondent en général sous 2 jours
-
bug(core): skip_nodes.json is missing SELECT and PRE, causing Python and Java to insert separators into dropdown options and preformatted textPeut-être pris @Bhumit267 l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
ExceptionThrowShouldUseContext: NullPointerException on a catch block inside an annotation typePeut-être pris @Carbon14-48 l’a pris aujourd’hui. Ouverteapproved
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
checkstyle/checkstyle#22784 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour