You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/01/28 01:37:08 UTC

[GitHub] starpit opened a new issue #3228: very expensive fillInStackTrace in Either[ActivationId,WhiskActivation]

starpit opened a new issue #3228: very expensive fillInStackTrace in Either[ActivationId,WhiskActivation]
URL: https://github.com/apache/incubator-openwhisk/issues/3228
 
 
   the controller spends a large number of CPU cycles filling in stack traces, due to the nature of the `CompletionMessage` and spray's deserialization of scala's `Either`.
   
   First, note how spray uses a try/catch pattern for `Either`, starting with the `Left`, the backing up to the `Right`: https://github.com/spray/spray-json/blob/master/src/main/scala/spray/json/AdditionalFormats.scala#L107
   
   Next, observe that CompletionMessage has an `Either[ActivationId, WhiskActivation]`, where the common case, for blocking invokes, is the latter.  Note that this means, for blocking invokes than take less than 60 seconds, we will always incur a fillInStackTrace, because the completion message will contain a `Right[WhiskActivation]` in those (common) cases.
   
   The fix is probably to use a custom serdes for our Either, perhaps reversing the order. Better, we should find a way to avoid the try/catch pattern to parsing altogether.

----------------------------------------------------------------
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