fix: address ulimit exhaustion of user within swag-proxies.py#1156
Merged
Conversation
Proxies table briefly loads then disappears on full page load. This will dynamically assign max_workers based on resource.RLIMIT_NPROC Signed-off-by: Chris <137902980+wandercone@users.noreply.github.com>
|
PR build pushed to |
quietsy
approved these changes
Jun 30, 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.
Proxies table briefly loads then disappears on full page load. This will dynamically assign max_workers based on resource.RLIMIT_NPROC
Description:
Make /dashboard/swag-proxies.py dynamically assign its worker count based on the current process/thread limit:
On the reported container (ulimit -u = 100) the script now uses min(50, 90) = 50 workers, leaving headroom for interpreter threads and avoiding the RuntimeError.
Benefits of this PR and context:
proxies.php executes /dashboard/swag-proxies.py without the fast flag. That script created a ThreadPoolExecutor(max_workers=100). When a ulimit nproc of soft/hard of 100 is specified within compose this causes the hard coded max_workers of 100 to exceed the limits.
RuntimeError: can't start new thread
The Python traceback was written to stdout, so PHP’s json_decode() received invalid JSON and returned null. proxies.php then iterated over null, producing an empty and the PHP warning:
PHP Warning: foreach() argument must be of type array|object, null given in /dashboard/www/proxies.php on line 18
Because the AJAX call replaces the whole table on success, the initially rendered rows were overwritten with an empty table.
How Has This Been Tested?
Loaded in browser and SWAG instance with 21 proxies loads as expected now with ulimits: nproc: soft: 100 and hard: 100.
Source / References:
n/a