Potential for SLURMCluster log directory creation failing
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- python
调研方向
从 dask_jobqueue/core.py 中 issue 链接所指的构造函数位置附近对 log_directory 的处理开始,并将其与所描述的并发 SLURMCluster 构造进行比较。检查当另一个 workflow 先创建路径时,目录创建的行为。完成标准是并发 workflow 可以使用同一个已存在的日志目录,而不会引发 FileExistsError。
由索引模型根据 Issue 内容生成。
描述
Describe the issue:
I am using dask_jobqueue.SLURMCluster in my workflows. I am running ~15 workflows at a time. I am getting unlucky and it seems like two separate workflows are both trying to create the output log directory. One would fail:
File "/datasets/work/jones-storage/work/miniconda/miniforge3/envs/flint_main/lib/python3.12/site-packages/dask_jobqueue/core.py", line 661, in __init__
self._dummy_job # trigger property to ensure that the job is valid
^^^^^^^^^^^^^^^
File "/datasets/work/jones-storage/work/miniconda/miniforge3/envs/flint_main/lib/python3.12/site-packages/dask_jobqueue/core.py", line 690, in _dummy_job
return self.job_cls(
^^^^^^^^^^^^^
File "/datasets/work/jones-storage/work/miniconda/miniforge3/envs/flint_main/lib/python3.12/site-packages/dask_jobqueue/slurm.py", line 37, in __init__
super().__init__(
File "/datasets/work/jones-storage/work/miniconda/miniforge3/envs/flint_main/lib/python3.12/site-packages/dask_jobqueue/core.py", line 375, in __init__
os.makedirs(self.log_directory)
File "<frozen os>", line 225, in makedirs
FileExistsError: [Errno 17] File exists: 'flint_logs'
Minimal Complete Verifiable Example:
Given the 'race condition' involved I am not able to give a concise single example. I am guessing that it is a case that the two workflows are both getting past:
and subsequently only one is successfully able to make the directory.
Would it make sense to use Pathlib.Path here? Something like
if self.log_directory:
log_path = Path(self.log_directory)
log_path.mkdir(exists_ok=True, parent=True)
Anything else we need to know?:
Environment:
- Dask version:
- Python version: Python 3.12.8
- Operating System: SLES 15.5
- Install method (conda, pip, source): pip
- dask_jobqueue: 0.9.0
- 主要语言
- Python
- 星标
- 256
- 派生
- 149
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dask/dask-jobqueue 的其他 Issue
-
bug LSF
难度 3/5 1-2 天 新手友好度 65/100
dask/dask-jobqueue#703 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
dask/dask-jobqueue#701 ·
-
难度 3/5 1-2 天 新手友好度 45/100
dask/dask-jobqueue#699 · 2 条评论 ·
-
bug
难度 4/5 3-5 天 新手友好度 35/100
dask/dask-jobqueue#691 · 7 条评论 ·
-
难度 2/5 半天 新手友好度 45/100
dask/dask-jobqueue#686 · 3 条评论 ·
查看 dask/dask-jobqueue 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 72/100
letsencrypt/cp-cps#353 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 84/100
PedestrianDynamics/pyFDS-Evac#394 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
DOI-USGS/pywatershed#421 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
python-pillow/Pillow#10087 · 1 条评论 ·
维护者通常 1 天内回复