Recurring Script Jobs can remain in Running status after their owner is deleted

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

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

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

評価

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

調査の方向性

Start by tracing how scheduled Script Jobs are queued, rescheduled, and saved, including the Job owner and the user stored in the queued request. Reproduce the deleted-owner case and the migrated schedule case with a disabled Script. The issue is resolved when each Job reaches a terminal status, and any schedule that cannot continue records the reason in its log; whether schedules continue without an owner still needs a decision.

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

説明

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

v0.1.0

NetBox Version

v4.7.6

Python Version

3.12

Steps to Reproduce
  1. Schedule a Script from the UI to run every five minutes.
  2. Delete the user who scheduled the Script before its next occurrence runs.
  3. Allow the worker to execute the scheduled occurrence.
  4. Check the Job's status and whether the next occurrence has been scheduled.

The same scenario should be tested with a migrated schedule whose Script is disabled before its next occurrence.

Expected Behavior

Deleting a schedule's owner should not prevent a Script Job from reaching a terminal status.

If the schedule cannot continue, the reason should be recorded in the Job's log.

Observed Behavior

The queued Job retains a reference to the deleted user. Rescheduling can fail validation, and subsequent attempts to save the Job can raise an IntegrityError.

This may leave the Job in Running status without scheduling its next occurrence.

Additional Context

This was identified during the implementation of #201. Refreshing the owner during class execution does not cover Jobs that fail before reaching that stage or schedules carrying an existing request.

Both the Job's owner and the queued request's user need to be considered.

Whether a schedule should continue without its original owner or stop with an explanatory log entry remains to be decided. Continuing without an owner may also affect change logging and object-change event processing.

主要言語
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 を短くまとめたダイジェスト。