microsoft / microsoft/azure-devops-python-api
This SDK isn't thread-safe (or even multi-process safe) because of OPTIONS cache
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 684
- 分支
- 218
- 平均合併
- 8 天 10 小時
- 30 天內合併 PR
- 1
描述
This SDK is crashing some of my build agents occasionally with this error:
[Errno 13] Permission denied: '/Users/USER_NAME/.azure-devops/python-sdk/cache/options.json'
Based on reading the code, it appears to be coming from here:
https://github.com/microsoft/azure-devops-python-api/blob/dev/azure-devops/azure/devops/_file_cache.py
This code doesn't appear to be at all thread, or even process, safe, as it just asserts handles to the file.
If it can't be made thread/process safe, some option to just not use the cache at all, and just fetch it directly when needed for the connection would work. As is now, I've had to implement a machine level mutex and lock all my calls to this API behind it, which is horribly inefficient, but I can't have my builds crashing with random IO errors.
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從 azure-devops/azure/devops/_file_cache.py 開始,追蹤 SDK 連線期間如何開啟和更新 options.json。如果可能,重現並行存取失敗,然後判斷是否能讓快取對執行緒和處理程序安全,或在停用時略過快取。完成標準是:組建代理程式並行使用時不再產生所回報的權限錯誤,且所選擇的行為已有文件說明。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- api, backend
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100