[PR #9201] [MERGED] Fixes #8959: Add lock around script loading to prevent race condition #13443

Closed
opened 2025-12-29 22:27:26 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/9201
Author: @kkthxbye-code
Created: 4/22/2022
Status: Merged
Merged: 4/25/2022
Merged by: @jeremystretch

Base: developHead: fix-8959


📝 Commits (1)

  • 84e4156 Add lock around script loading to prevent race condition

📊 Changes

1 file changed (+10 additions, -4 deletions)

View changed files

📝 netbox/extras/scripts.py (+10 -4)

📄 Description

Fixes: #8959

Simply add a lock around the non-threadsafe section.

Tested with the threaded runserver. As the function is not really a hot path, the slight performance loss when receiving multiple requests at the same time should be almost unnoticable.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/9201 **Author:** [@kkthxbye-code](https://github.com/kkthxbye-code) **Created:** 4/22/2022 **Status:** ✅ Merged **Merged:** 4/25/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `fix-8959` --- ### 📝 Commits (1) - [`84e4156`](https://github.com/netbox-community/netbox/commit/84e415625968592106dd693094da4055df11846b) Add lock around script loading to prevent race condition ### 📊 Changes **1 file changed** (+10 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/scripts.py` (+10 -4) </details> ### 📄 Description ### Fixes: #8959 Simply add a lock around the non-threadsafe section. Tested with the threaded runserver. As the function is not really a hot path, the slight performance loss when receiving multiple requests at the same time should be almost unnoticable. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 22:27:26 +01:00
adam closed this issue 2025-12-29 22:27:26 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13443