tysonnorris opened a new issue #3918: on "application error", return 
success=false, but should not destroy the container
URL: https://github.com/apache/incubator-openwhisk/issues/3918
 
 
   <!--
   We use the issue tracker for bugs and feature requests. For general 
questions and discussion please use http://slack.openwhisk.org/ or 
https://openwhisk.apache.org/contact.html instead.
   
   Do NOT share passwords, credentials or other confidential information.
   
   Before creating a new issue, please check if there is one already open that
   fits the defect you are reporting.
   If you open an issue and realize later it is a duplicate of a pre-existing
   open issue, please close yours and add a comment to the other.
   
   Issues can be created for either defects or enhancement requests. If you are 
a committer than please add the labels "bug" or "feature". If you are not a 
committer please make clear in the comments which one it is, so that committers 
can add these labels later.
   
   If you are reporting a defect, please edit the issue description to include 
the
   information shown below.
   
   If you are reporting an enhancement request, please include information on 
what you are trying to achieve and why that enhancement would help you.
   
   For more information about reporting issues, see
   
https://github.com/apache/incubator-openwhisk/blob/master/CONTRIBUTING.md#raising-issues
   
   Use the commands below to provide key information from your environment:
   You do not have to include this information if this is a feature request.
   -->
   
   ## Environment details:
   
   * local deployment 
   
   ## Steps to reproduce the issue:
   
   1.   create an action that returns as: 
   ```
   return {error: "this was a failure..."}
   ```
   2.   invoke the action repeatedly
   3.   Note that each invocation returns an "initTime", indicating no 
container reuse, and also in invoker logs, container is destroyed, despite a 
200 response:
   ```[2018-07-30T17:39:14.144Z] [INFO] [#tid_Ebq8zgXiJVIQJyJJVxk57kOu6jal0BUB] 
[DockerContainer] running result: ok 
[marker:invoker_activationRun_finish:546:11]
   [2018-07-30T17:39:14.145Z] [INFO] [#tid_Ebq8zgXiJVIQJyJJVxk57kOu6jal0BUB] 
[ContainerProxy]  [marker:invoker_collectLogs_start:547]
   [2018-07-30T17:39:14.156Z] [INFO] [#tid_Ebq8zgXiJVIQJyJJVxk57kOu6jal0BUB] 
[InvokerReactive] posted completion of activation 
89e79852c3fd4768a79852c3fd47688d
   [2018-07-30T17:39:14.175Z] [INFO] [#tid_Ebq8zgXiJVIQJyJJVxk57kOu6jal0BUB] 
[ContainerProxy]  [marker:invoker_collectLogs_finish:578:31]
   [2018-07-30T17:39:14.178Z] [INFO] [#tid_Ebq8zgXiJVIQJyJJVxk57kOu6jal0BUB] 
[CouchDbRestStore] [PUT] 'whisk_local_activations' saving document: 'id: 
guest/89e79852c3fd4768a79852c3fd47688d, rev: null' 
[marker:database_saveDocument_start:581]
   [2018-07-30T17:39:14.180Z] [INFO] [#tid_sid_dbBatcher] [CouchDbRestStore] 
'whisk_local_activations' saving 1 documents 
[marker:database_saveDocumentBulk_start:38009]
   [2018-07-30T17:39:14.192Z] [INFO] [#tid_sid_invokerNanny] 
[DockerClientWithFileAccess] running /usr/bin/docker rm -f 
4090ec441622f9eedd13c3b244b1f1fa5f3d9d7a74e3d92dad087665a7ff8e79 (timeout: 1 
minute) [marker:invoker_docker.rm_start:38018]
   ``` 
   
   
   ## Provide the expected results and outputs:
   
   Container reuse should be possible on an error that was gracefully handled 
by the action. 
   
   
   ## Provide the actual results and outputs:
   
   Container is not reused.
   
   ## Additional information you deem important:
   
   Is there a reason for this? I couldn't find good docs on the handling of 
"application error" state, where container operates properly but returns an 
error. A typical use case is "parameter validation" - there is no reason the 
container cannot be reused if it simply rejects the activation based on invalid 
input, as opposed to bubbling up an exception or some non-200 response.
   
   This can be handled in `ContainerProxy` by updating:
   ```
   case Right(act) if !act.response.isSuccess
   ```
   to
   ```
   case Right(act) if !act.response.isSuccess && 
!act.response.isApplicationError
   ```
   
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to