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 2019/07/11 10:02:59 UTC

[GitHub] [incubator-openwhisk] style95 commented on issue #4541: Disable MesosContainerFactory from subscribing after close

style95 commented on issue #4541: Disable MesosContainerFactory from subscribing after close
URL: https://github.com/apache/incubator-openwhisk/pull/4541#issuecomment-510420965
 
 
   I am not quite sure but I think the issue is happening in this way.
   
   `MesosContainerFactory` ask to the `mesosClientActor` which is `testActor` in test cases. 
   ```scala
   private def subscribe(): Future[Unit] = {
       logging.info(this, s"subscribing to Mesos master at ${mesosConfig.masterUrl}")
       mesosClientActor  // here
         .ask(Subscribe)(mesosConfig.timeouts.subscribe)
         .mapTo[SubscribeComplete]
         .map(complete => logging.info(this, s"subscribe completed successfully... $complete"))
         .recoverWith {
           case e =>
             logging.error(this, s"subscribe failed... $e}")
             if (closed) Future.successful(()) else subscribe()
         }
     }
   ```
   
   ```scala
       factory = new MesosContainerFactory(
         wskConfig,
         system,
         logging,
         Map("--arg1" -> Set("v1", "v2"), "--arg2" -> Set("v3", "v4"), "other" -> Set("v5", "v6")),
         containerArgsConfig,
         mesosConfig = mesosConfig,
         clientFactory = (_, _) => testActor, // here
         taskIdGenerator = testTaskId _)
   ```
   
   Since `testActor` does not respond to the request `Subscribe`, `ask` request will be timed out and be caught by `recoverWith`.
   `recoverWith` logic will be asynchronously executed by another thread and the thread will call `subscribe()` again and be timed out recursively.
   
   
   So I think one easy way could be to define a simple testing actor which respond with static `SubscribeComplete` response against `Subscribe` request and pass the testing actor to the `MesosContainerFactory` instead of using just `testActor`.
   (We may want to define `AutoPilot` instead of defining a simple actor, but anyway)
   
   Since I did not look into the `MesosContainerFactory` logic in-depth, it would be great if @tysonnorris confirm this behavior once.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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