A built-in run cancelled by migration cutover can still execute

未关闭
#1 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@pheus 已经在做这个了。

开始于 2026年10月23日。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

Reproduce the race through Customization > Scripts and Scripts > Migration with one RQ worker, following the linked migration guide's worker arrangement. Observe the queued task across cancellation, cutover, and repointing, including a recurring run. Done means a cancelled built-in run does not execute, its eligible replacement runs once through the plugin, and no later built-in occurrence survives the completed cutover.

由索引模型根据 Issue 内容生成。

描述

app: scripts status: needs triage type: bug
Plugin Version

v0.0.1

NetBox Version

v4.7.1

Python Version

3.12

Steps to Reproduce
  1. Under Customization > Scripts, schedule a built-in Custom Script to run a few minutes ahead. Use a recurring run to observe the scheduling effects as well.
  2. Under Scripts > Migration, run inventory and Stage Projects, then wait for valid revisions. Keep one RQ worker running.
  3. Select Enter cutover so cancellation overlaps the scheduler queueing the now-due run. This is a timing race. With Accept concurrent workers selected, a second worker taking the run just before cancellation can produce the same result.
  4. Run Activate Projects, then Repoint references.
Expected Behavior

A run reported as cancelled does not execute on the built-in side. Its eligible replacement executes once through the plugin.

Observed Behavior

The built-in Script executes despite the cancellation. Its Job changes from Failed back to Running. If it starts after repointing has recreated the run, both versions execute.

A recurring run also queues another built-in occurrence. The Jobs page may associate that occurrence with the replacement Script even though it still executes the built-in Script. The completed cutover does not cancel it, so the built-in schedule continues and cleanup retains its module.

NetBox starts the Job from the queued task's copy without checking the intervening cancellation. The migration guide describes the scheduler window.

主要语言
Python
星标
8
派生
0
平均合并
11 小时 23 分钟
30 天内合并 PR
24

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

netbox-community/netbox-scripts 的其他 Issue

查看 netbox-community/netbox-scripts 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。