-
Notifications
You must be signed in to change notification settings - Fork 43
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
support large arguments #3
Conversation
Closes apache/openwhisk#2542. @jthomas can you review. |
stderr=subprocess.PIPE, | ||
env=env) | ||
else: | ||
# pass argument via stdin and command parameter |
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.
I suggest that we always do this. That is we migrate all actions to use the stdin
path instead of argv[1]
. The code above will be a fail safe for all existing actions which will only work up to 128K.
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.
I agree with this. stdin
should be the default. Input can be passed as an argument as well but not if it's larger than 128K.
We will need to add a test. You can use this example, which I did for swift to test the change. |
LGTM. |
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.
See comments.
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.
like @rabbah already said it needs a test
…hisk-runtime-docker into largeArguments
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.
We could have made an addition to the standard tests all the runtimes run (bash, Perl, Swift, python) to check no regressions in the future for the large inputs.
stderr=subprocess.PIPE, | ||
env=env) | ||
if len(input) > 131071: # MAX_ARG_STRLEN (131071) linux/binfmts.h | ||
# pass argument via stdin |
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.
The if/else could be simpler.
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.
I agree and can also read your mind 😉
Send the PR and I will merge
Swift? There is no swift in this repo |
I think I will add the tests to the std ones don’t worry |
👍 Thanks. I was basically thinking adding a variant of the echo test would do (the |
Yep you read my mind 💯 |
There is a limit of the argument size in a command line (MAX_ARG_STRLEN = 131071 bytes) .
To support larger sizes, the input to the action code is passed via standard input.
To support also legacy action code (not reading input from stdin), but only if the input size is smaller than the limit, the input is also passed as a command line parameter.