microsoft / microsoft/azure-devops-python-api
This SDK isn't thread-safe (or even multi-process safe) because of OPTIONS cache
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 684
- フォーク
- 218
- 平均マージ
- 8日 10時間
- マージ済み PR(30日)
- 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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
azure-devops/azure/devops/_file_cache.py から始め、SDK 接続中に options.json がどのように開かれ、更新されるかを追跡します。可能であれば同時アクセスによる障害を再現し、その後、キャッシュをスレッドおよびプロセスに対して安全にできるか、または無効時にバイパスできるかを判断します。ビルドエージェントによる同時使用で報告された権限エラーが発生しなくなり、選択した動作が文書化されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api, backend
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100