[PR #7861] [MERGED] Fixes #7657: Make request/webhook caching thread-safe #13292

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

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/7861
Author: @jeremystretch
Created: 11/17/2021
Status: Merged
Merged: 11/24/2021
Merged by: @jeremystretch

Base: developHead: 7657-threadsafe-changelog


📝 Commits (1)

  • 0d60099 Move request object and webhook queue to TLS

📊 Changes

6 files changed (+42 additions, -29 deletions)

View changed files

📝 netbox/extras/context_managers.py (+10 -10)
📝 netbox/extras/signals.py (+17 -9)
📝 netbox/netbox/__init__.py (+3 -0)
📝 netbox/netbox/middleware.py (+3 -3)
netbox/netbox/request_context.py (+9 -0)
📝 netbox/utilities/utils.py (+0 -7)

📄 Description

Fixes: #7657

  • Employ thread-local storage for capturing the request object and webhook queue
  • Remove currying of these variables into the signal handlers

Initial testing seems to confirm that this resolves the bug without any negative effects, however further testing by other individuals would be greatly appreciated.


🔄 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/7861 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 11/17/2021 **Status:** ✅ Merged **Merged:** 11/24/2021 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `7657-threadsafe-changelog` --- ### 📝 Commits (1) - [`0d60099`](https://github.com/netbox-community/netbox/commit/0d600995883ce3ec5758f850d5fc7fc2f823e0d1) Move request object and webhook queue to TLS ### 📊 Changes **6 files changed** (+42 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `netbox/extras/context_managers.py` (+10 -10) 📝 `netbox/extras/signals.py` (+17 -9) 📝 `netbox/netbox/__init__.py` (+3 -0) 📝 `netbox/netbox/middleware.py` (+3 -3) ➕ `netbox/netbox/request_context.py` (+9 -0) 📝 `netbox/utilities/utils.py` (+0 -7) </details> ### 📄 Description ### Fixes: #7657 - Employ thread-local storage for capturing the request object and webhook queue - Remove currying of these variables into the signal handlers Initial testing seems to confirm that this resolves the bug without any negative effects, however further testing by other individuals would be greatly appreciated. --- <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:26:35 +01:00
adam closed this issue 2025-12-29 22:26:35 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13292