Concurrent project renames can nest projects and mix files on push
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start in the project manager that implements get_local_project_path and rename_project_and_contents, and follow how PushManager._push_project and _push_metadata use the returned destination. Reproduce the interleaving in a test using a temporary filesystem, then make destination claiming reject an already-occupied target and reselect instead of relying on shutil.move. Done means both main.py files stay in separate sibling trees and get_source_files on each destination returns only its own file.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Destination selection and project renaming are not atomic. Two pushes in the same workspace can select the same currently free sanitized name. If one moves first, the other shutil.move nests its source inside the now-existing destination rather than rejecting the collision. Source enumeration then includes both projects' files.
Reproduction and evidence
Reproduced on master at 508863e using real project/configuration managers and a temporary filesystem, with the two operations deliberately interleaved:
- Create
Race@Projectwith cloud ID 1 andmain.pycontaining# SOURCE 1. - Create
Race#Projectwith cloud ID 2 andmain.pycontaining# SOURCE 2. - Resolve both destinations before moving either:
Both return the nonexistentfirst_destination = manager.get_local_project_path(first.name, cloud_id=1, source_path=first) second_destination = manager.get_local_project_path(second.name, cloud_id=2, source_path=second)Race Projectdirectory. - Call
rename_project_and_contents(first, first_destination), thenrename_project_and_contents(second, second_destination). - Both moves return successfully. The second project is now
Race Project/Race#Project, not a separate sibling. get_source_files(second_destination)returns both:main.py:# SOURCE 1Race#Project/main.py:# SOURCE 2
PushManager._push_project resumes at the selected destination after its rename; _push_metadata reads the files there. The interleaving therefore makes the second push consume the first project's root files as well as the nested second project's files.
Expected result
A destination that becomes occupied between lookup and rename must not cause nesting or selection of another project's files. Preserve both source trees and keep their upload inputs separate. Add a regression covering the interleaving above.
Suggestion: make destination claiming/moving reject an occupied target and retry selection, rather than relying on shutil.move's directory-container behavior.
This requires overlapping renames in the same workspace. Serializing pushes is a workaround.
- Lingua principale
- Python
- Stelle
- 335
- Fork
- 172
- Merge medio
- 6h 54m
- PR unite (30g)
- 37
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di QuantConnect/lean-cli
-
priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
QuantConnect/lean-cli#792 ·
I maintainer di solito rispondono entro 1 giorno
-
priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
QuantConnect/lean-cli#786 ·
I maintainer di solito rispondono entro 1 giorno
-
priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
QuantConnect/lean-cli#785 ·
I maintainer di solito rispondono entro 1 giorno
-
A partially written live command result aborts polling with JSONDecodeErrorForse già presa @pcbeingused333 l’ha presa 3 giorni fa. Apertapriority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
QuantConnect/lean-cli#784 ·
I maintainer di solito rispondono entro 1 giorno
-
Container lookup failures during result polling are masked by UnboundLocalErrorForse già presa @pcbeingused333 l’ha presa 5 giorni fa. Apertapriority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
QuantConnect/lean-cli#783 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di QuantConnect/lean-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pimutils/vdirsyncer#1242 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
open-webui/open-webui#35360 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno