microsoft / microsoft/azure-devops-python-api

This SDK isn't thread-safe (or even multi-process safe) because of OPTIONS cache

オープン
#388 コメント 6 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

azure-devops/azure/devops/_file_cache.py から始め、SDK 接続中に options.json がどのように開かれ、更新されるかを追跡します。可能であれば同時アクセスによる障害を再現し、その後、キャッシュをスレッドおよびプロセスに対して安全にできるか、または無効時にバイパスできるかを判断します。ビルドエージェントによる同時使用で報告された権限エラーが発生しなくなり、選択した動作が文書化されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api, backend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。