You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/01/26 17:19:48 UTC

[GitHub] jthomas commented on a change in pull request #3: support large arguments

jthomas commented on a change in pull request #3: support large arguments
URL: https://github.com/apache/incubator-openwhisk-runtime-docker/pull/3#discussion_r164169939
 
 

 ##########
 File path: core/actionProxy/actionproxy.py
 ##########
 @@ -127,18 +127,29 @@ def error(msg):
 
         try:
             input = json.dumps(args)
-            p = subprocess.Popen(
-                [self.binary, input],
-                stdout=subprocess.PIPE,
-                stderr=subprocess.PIPE,
-                env=env)
+            if len(input) > 131071:             # MAX_ARG_STRLEN (131071) linux/binfmts.h
+                # pass argument via stdin
+                p = subprocess.Popen(
+                    [self.binary],
+                    stdin=subprocess.PIPE,
+                    stdout=subprocess.PIPE,
+                    stderr=subprocess.PIPE,
+                    env=env)
+            else:
+                # pass argument via stdin and command parameter
 
 Review comment:
   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.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services