-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: max_workers / give kinda helpful message if too many open files #1110
feature: max_workers / give kinda helpful message if too many open files #1110
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable to me for parallel_attempts
, what are your thoughts on adding a similar guard in generators/base.py
related to parallel_requests
as well?
In theory, if both were set the error would bubble up from the generator sub-processes however since parallel_requests
is independent a generator that requires a single request per call could produce a similar error when parallel_attempts
was not set.
At the same time I wonder about the value of catching OSError like this, are we going down a path that will require additional handlers for various resource limitation errors across supported operating systems?
Consider the command used to test this, run on a Windows installl with only 4GB of RAM can raise:
File "C:\Users\Win10x64\miniconda3\Lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
^^^^^^^^^^^^^^^^^
File "C:\Users\Win10x64\miniconda3\Lib\multiprocessing\context.py", line 337, in _Popen
return Popen(process_obj)
^^^^^^^^^^^^^^^^^^
File "C:\Users\Win10x64\miniconda3\Lib\multiprocessing\popen_spawn_win32.py", line 75, in __init__
hp, ht, pid, tid = _winapi.CreateProcess(
^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 1455] The paging file is too small for this operation to complete
Amendments:
Validation:
-- i hope the windows message is alright - i don't have a great idea of how this goes wrong |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for extending to parallel_requests
this looks ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the churn, final validation identified that the new system.max_workers
is not taking overrides into account.
garak.site.yaml:
system:
max_workers: 2000
python -m garak: error: argument --parallel_attempts: Parallel worker count capped at 500 (config.system.max_workers)
057bfd4
to
2af0fe7
Compare
Signed-off-by: Jeffrey Martin <[email protected]>
rebase looks good to me, happy to merge |
Latest updates look good. There are still some edge cases that might pop up in the future around ensuring a config file set value is valid however that is out of scope here for now.
Signed-off-by: Jeffrey Martin <[email protected]>
5677c03
to
fae9834
Compare
OS can get upset if parallel_attempts goes too high. Give a clearer error message about this.
Verification
List the steps needed to make sure this thing works
garak -m test -p test.Test --parallel_attempts 1000
, the new error should pop up on CLI and in log. If it doesn't, try a higher number, or reduce ulimit.