Concurrent Project creation allows overlapping Data Source paths

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

メンテナーはふだん 1 日以内に返信

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

評価

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

調査の方向性

The bug is in the POST handler for /api/plugins/netbox-scripts/projects/, where data path overlap is validated before the Project is saved. Start by finding that validation and the create path, then check how it runs inside a transaction. Reproduce with two concurrent requests using the steps in the issue. Done means concurrent creation of overlapping Projects on one Data Source is rejected, and the existing edit validation still passes.

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

説明

app: scripts Bucket: KTLO severity: low status: backlog type: bug
Plugin Version

v0.1.0

NetBox Version

v4.7.6

Python Version

3.12

Steps to Reproduce
  1. Create and synchronize a Data Source containing the directory automation/netbox.
  2. From separate clients, concurrently send two POST requests to /api/plugins/netbox-scripts/projects/ to create Data Source-backed Projects on the same Data Source, using distinct names and keys and the following data paths:
    • automation
    • automation/netbox
  3. Check the resulting Projects.
Expected Behavior

One request succeeds and the other is rejected with a validation error. Projects on the same Data Source must not have overlapping directories.

Observed Behavior

If both requests validate before either transaction commits, both Projects can be created despite their overlapping directories.

Subsequent attempts to edit either Project fail validation because of the overlapping data paths.

The race condition was reproduced using separate database sessions on the development branch for #33.

主要言語
Python
スター
9
フォーク
0
平均マージ
18時間 59分
マージ済み PR(30日)
93

環境構築

はじめの一歩

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

netbox-community/netbox-scripts のほかの issue

netbox-community/netbox-scripts の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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