-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Limit of binary actions is too low. #3835
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
Conversation
@rabbah Thanks for the pointer. I wasn't aware of this issue. But I think this PR will close this issue as well. |
Codecov Report
@@ Coverage Diff @@
## master #3835 +/- ##
==========================================
- Coverage 75.81% 71.06% -4.75%
==========================================
Files 146 146
Lines 6902 6906 +4
Branches 428 428
==========================================
- Hits 5233 4908 -325
- Misses 1669 1998 +329
Continue to review full report at Codecov.
|
PG5#514 🔵 |
965676c
to
69cd891
Compare
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.
Overall, very good pull request. Only minor suggestions regarding addition of tests and comment clarification.
ansible/group_vars/all
Outdated
@@ -56,6 +56,8 @@ limits: | |||
concurrentInvocationsSystem: "{{ limit_invocations_concurrent_system | default(5000) }}" | |||
firesPerMinute: "{{ limit_fires_per_minute | default(60) }}" | |||
sequenceMaxLength: "{{ limit_sequence_max_length | default(50) }}" | |||
actionCodeMb: "{{ limit_action_code_mb | default(48) }}" |
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 to add a comment indicating this is the net action code limit while the gross limit is 4/3 * the net limit because of Base64 encoding.
ansible/group_vars/all
Outdated
@@ -56,6 +56,8 @@ limits: | |||
concurrentInvocationsSystem: "{{ limit_invocations_concurrent_system | default(5000) }}" | |||
firesPerMinute: "{{ limit_fires_per_minute | default(60) }}" | |||
sequenceMaxLength: "{{ limit_sequence_max_length | default(50) }}" | |||
actionCodeMb: "{{ limit_action_code_mb | default(48) }}" | |||
parametersMb: "{{ limit_parameters_mb | default(1) }}" |
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 to add a comment indicating that this size limit also applies to annotations, not only to parameters. And in contrast to the action code size limit, this is a gross limit because we do not perform any Base64 encoding for parameters / annotations.
@@ -124,6 +124,10 @@ | |||
"COMPONENT_NAME": "{{ controller_name }}" | |||
"PORT": 8080 | |||
|
|||
# Allow base64 overhead of action-code, parameters and annotations. |
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 comment is a little misleading because there is no Base64 overhead for parameters and annotations.
@@ -124,6 +124,10 @@ | |||
"COMPONENT_NAME": "{{ controller_name }}" | |||
"PORT": 8080 | |||
|
|||
# Allow base64 overhead of action-code, parameters and annotations. | |||
"CONFIG_akka_http_server_parsing_maxContentLength": "{{ (limits.actionCodeMb | int * 4 / 3 + limits.parametersMb | int * 2) | round(0, 'ceil') | int }}m" |
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.
It may be valuable to add a comment that this setting does only consider the code
, parameters
and annotations
parts in JSON messages because these are potentially the largest parts. If somebody uses very large values for code, a long name
value may still overflow the message body.
@@ -328,6 +328,25 @@ class ActionLimitsTests extends TestHelpers with WskTestHelpers with WskActorSys | |||
actionCode.delete | |||
} | |||
|
|||
it should "succeed on creating an binary-action with binary exec which is not too big before encoding" in withAssetCleaner( |
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 think you should add a test that actually invokes a very large action to make sure that the DB client in the invoker is able to GET a large action JSON. This should be a large action which is Base64 encoded.
Maybe you could also add a component test for adding / updating / deleting a large action to https://github.com/apache/incubator-openwhisk/blob/master/tests/src/test/scala/whisk/core/entity/test/DatastoreTests.scala?
@@ -10,7 +10,8 @@ events { | |||
|
|||
http { | |||
{# allow large uploads, need to thread proper limit into here #} | |||
client_max_body_size 50M; | |||
# Allow base64 overhead of action-code, parameters and annotations. |
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 comment is a little misleading because there is no Base64 overhead for parameters and annotations.
@@ -93,6 +93,30 @@ class SizeTests extends FlatSpec with Matchers { | |||
} | |||
} | |||
|
|||
// Multiplication |
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.
Add a test for: 1.B * 0
. What happens if you multiply with / divide by negative numbers? Should this be supported?
1.MB / 512 should be(2 KB) | ||
} | ||
|
||
it should "throw an exception if division is through 0" in { |
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.
... if division is by 0 ...
A more general finding: PR #3209 introduced a configurable limit for parameters in an activation. I guess it makes sense to use the same configuration settings for parameter size and activation parameter size. Can you please check how this could be done? |
Is there any task in-progress regarding this issue? |
@cbickel this has rotted - what's the plan? |
I'll close the PR for now, due to long inactivity from my side. |
On creating an action, the code is sent to the controller. Afterwards the controller checks, that the code is not too big. If the code itself is sent directly (e.g. uploading a single
.js
file), the limit is 48MB (today).If an archive is uploaded, it will be encoded with base64. The problem here is, that base64 has an overhead of 1/3. This means, if you have an archive, that has a size of e.g. 45MB, 60MB will be sent to the controller. So the request will be rejected. This is not expected for the user, as a limit of 48MB was proposed to him.
This PR fixes that bug.
Related issue and scope
My changes affect the following components
Types of changes
Checklist: