tardieu commented on a change in pull request #3202: Support action 
continuations in the controller
URL: 
https://github.com/apache/incubator-openwhisk/pull/3202#discussion_r166395783
 
 

 ##########
 File path: 
core/controller/src/main/scala/whisk/core/controller/actions/PrimitiveActions.scala
 ##########
 @@ -140,6 +200,387 @@ protected[actions] trait PrimitiveActions {
     }
   }
 
+  /**
+   * Mutable cumulative accounting of what happened during the execution of a 
composition.
+   *
+   * Compositions are aborted if the number of action invocations exceeds a 
limit.
+   * The permitted max is n component invocations plus 2n+1 conductor 
invocations (where n is the actionSequenceLimit).
+   * The max is chosen to permit a sequence with up to n primitive actions.
+   *
+   * NOTE:
+   * A sequence invocation counts as one invocation irrespective of the number 
of action invocations in the sequence.
+   * If one component of a composition is also a composition, the caller and 
callee share the same accounting object.
+   * The counts are shared between callers and callees so the limit applies 
globally.
+   *
+   * @param components the current count of component actions already invoked
+   * @param conductors the current count of conductor actions already invoked
+   */
+  private case class CompositionAccounting(var components: Int = 0, var 
conductors: Int = 0)
 
 Review comment:
   Thanks to mutability, it is clear that there is only one 
CompositionAccounting object ever allocated in the course of the execution of a 
composition. Therefore there is only one set of counters. With object copies on 
the other hand, it is hard to keep track of the copies. Why are copies being 
made, where, when? Are the multiple sets of counters concurrently valid and 
useful? Moreover, immutability does not prevent forking the object, hence 
concurrency issues.
   
   Give me ownership types and strong updates... and then I buy your argument. 
But without ownership control, I am afraid we are discussing style more than 
safety.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to