Fix Netmap crash on oversized cache objects#3795
Merged
lunkwill42 merged 2 commits into5.17.xfrom Feb 19, 2026
Merged
Conversation
Large topology graphs can exceed memcached's default 1MB item size limit, causing `cache.set()` to raise `MemcacheServerError`. This crashed the request even though the data was computed successfully. Wrap all `cache.set()` calls in `_safe_cache_set()` that catches exceptions and logs a warning, returning the response uncached rather than failing with a 500 error.
58c4c7a to
d9a5c39
Compare
|
Test results 20 files 20 suites 25m 0s ⏱️ Results for commit d9a5c39. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 5.17.x #3795 +/- ##
==========================================
+ Coverage 63.33% 63.38% +0.04%
==========================================
Files 619 619
Lines 45875 45882 +7
Branches 43 43
==========================================
+ Hits 29057 29083 +26
+ Misses 16808 16789 -19
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
johannaengland
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Scope and purpose
Fixes a production crash where Netmap returns a 500 error when the layer 2 topology graph exceeds memcached's default max item size (1MB). The
MemcacheServerError: b'object too large for cache'exception propagated up fromcache.set()even though the graph data was computed successfully.This pull request
adds/changes/removes a dependencychanges the databasechanges the APIContributor Checklist
Added/changed documentation<major>.<minor>.x). For a new feature or other additions, it should be based onmaster.If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be doneIf this results in changes in the UI: Added screenshots of the before and afterIf this adds a new Python source code file: Added the boilerplate header to that file