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

Đang mở
#222 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend, databases

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
9
Fork
0
Merge trung bình
18 giờ 59 phút
Pull request đã merge (30 ngày)
93

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của netbox-community/netbox-scripts

Tất cả issue của netbox-community/netbox-scripts

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.