Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

REST updates can deadlock with activation or uploads on NetBox v4.7.4

Abierto
#66 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
postgresql, python

Línea de trabajo

Start by tracing the update hooks for Script Projects and Script Files alongside the activation and upload paths; the issue does not name specific files or tests. Reproduce the overlapping requests in two sessions, including the reported Project PATCH and activation case, then inspect how each path acquires row and advisory locks. Done means concurrent updates, activation, and uploads wait without deadlocking while validation, permissions, and If-Match behavior still apply.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

v0.0.1

NetBox Version

v4.7.4

Python Version

3.12

Steps to Reproduce

The operations must overlap; the timing window is narrow.

  1. Create a Script Project with a valid revision available for activation.
  2. Start activating that revision.
  3. At the same time, send PATCH /api/plugins/netbox-scripts/projects/<id>/ for that Project with {"description": "edited"}.

The same lock-order conflict exists for Script Files: upload a file that re-enables an existing disabled Script File while another request updates that file through PATCH /api/plugins/netbox-scripts/script-files/<id>/.

Single and bulk PUT/PATCH updates are affected. The conflict does not require If-Match.

Expected Behavior

Concurrent operations use a consistent lock order and wait for each other without deadlocking. Normal validation, permission checks, and If-Match handling still apply.

Observed Behavior

NetBox v4.7.4 locks the updated rows before the plugin's update hooks acquire the Project's advisory lock. Activation and uploads acquire these locks in the opposite order. If the operations overlap at these points, each can hold the lock the other needs.

The Project PATCH/activation case was reproduced in a controlled two-session test, both with and without If-Match. PostgreSQL raised deadlock detected (SQLSTATE 40P01) for PATCH while activation completed.

Lenguaje dominante
Python
Estrellas
8
Forks
0
Merge medio
11 h 35 min
PR fusionados (30 d)
20

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de netbox-community/netbox-scripts

Todos los issues de netbox-community/netbox-scripts

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.