markusthoemmes commented on a change in pull request #3710: Make REST 
communication with action containers more robust
URL: 
https://github.com/apache/incubator-openwhisk/pull/3710#discussion_r191332156
 
 

 ##########
 File path: common/scala/src/main/scala/whisk/core/containerpool/HttpUtils.scala
 ##########
 @@ -68,20 +71,24 @@ protected[core] class HttpUtils(hostname: String, timeout: 
FiniteDuration, maxRe
    * @param retry whether or not to retry on connection failure
    * @return Left(Error Message) or Right(Status Code, Response as UTF-8 
String)
    */
-  def post(endpoint: String, body: JsValue, retry: Boolean): 
Either[ContainerHttpError, ContainerResponse] = {
+  def post(endpoint: String, body: JsValue, retry: Boolean)(
+    implicit tid: TransactionId): Either[ContainerHttpError, 
ContainerResponse] = {
     val entity = new StringEntity(body.compactPrint, StandardCharsets.UTF_8)
     entity.setContentType("application/json")
 
     val request = new HttpPost(baseUri.setPath(endpoint).build)
     request.addHeader(HttpHeaders.ACCEPT, "application/json")
     request.setEntity(entity)
 
-    execute(request, timeout.toMillis.toInt, retry)
+    execute(request, timeout, retry)
   }
 
-  private def execute(request: HttpRequestBase,
-                      timeoutMsec: Integer,
-                      retry: Boolean): Either[ContainerHttpError, 
ContainerResponse] = {
+  // Used internally to wrap all exceptions for which the request can be 
retried
+  private case class RetryableConnectionError(t: Throwable) extends 
Exception(t) with NoStackTrace
 
 Review comment:
   Nice!

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