Concurrent project renames can nest projects and mix files on push
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Python
- 星标
- 335
- 派生
- 172
- 平均合并
- 6 小时 54 分钟
- 30 天内合并 PR
- 37
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
QuantConnect/lean-cli 的其他 Issue
-
priority:P2
难度 2/5 1-3 小时 新手友好度 75/100
QuantConnect/lean-cli#792 ·
维护者通常 1 天内回复
-
priority:P2
难度 2/5 1-3 小时 新手友好度 74/100
QuantConnect/lean-cli#786 ·
维护者通常 1 天内回复
-
priority:P2
难度 2/5 1-3 小时 新手友好度 72/100
QuantConnect/lean-cli#785 ·
维护者通常 1 天内回复
-
A partially written live command result aborts polling with JSONDecodeError可能已有人在做 @pcbeingused333 于 3 天前认领。 未关闭priority:P2
难度 2/5 1-3 小时 新手友好度 72/100
QuantConnect/lean-cli#784 ·
维护者通常 1 天内回复
-
Container lookup failures during result polling are masked by UnboundLocalError可能已有人在做 @pcbeingused333 于 5 天前认领。 未关闭priority:P2
难度 2/5 1-3 小时 新手友好度 80/100
QuantConnect/lean-cli#783 ·
维护者通常 1 天内回复
查看 QuantConnect/lean-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
pimutils/vdirsyncer#1242 ·
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
open-webui/open-webui#35360 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)未关闭
难度 1/5 1 小时以内 新手友好度 68/100
-
bug
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复