gearpump-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manuzhang <...@git.apache.org>
Subject [GitHub] incubator-gearpump pull request #169: [GEARPUMP-285] fix false alarm of shut...
Date Thu, 09 Mar 2017 12:23:14 GMT
Github user manuzhang commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/169#discussion_r105150887
  
    --- Diff: core/src/main/scala/org/apache/gearpump/cluster/master/AppManager.scala ---
    @@ -231,35 +231,38 @@ private[cluster] class AppManager(kvService: ActorRef, launcher:
AppMasterLaunch
           timeStamp: TimeStamp, error: Throwable): Unit = {
         applicationRegistry.get(appId) match {
           case Some(appRuntimeInfo) =>
    -        var updatedStatus: ApplicationRuntimeInfo = null
    -        LOG.info(s"Application $appId change to ${newStatus.toString} at $timeStamp")
    -        newStatus match {
    -          case ApplicationStatus.ACTIVE =>
    -            updatedStatus = appRuntimeInfo.onAppMasterActivated(timeStamp)
    -            sender ! AppMasterActivated(appId)
    -          case succeeded@ApplicationStatus.SUCCEEDED =>
    -            killAppMaster(appId, appRuntimeInfo.worker)
    -            updatedStatus = appRuntimeInfo.onFinalStatus(timeStamp, succeeded)
    -            appResultListeners.getOrElse(appId, List.empty).foreach{ client =>
    -              client ! ApplicationSucceeded(appId)
    -            }
    -          case failed@ApplicationStatus.FAILED =>
    -            killAppMaster(appId, appRuntimeInfo.worker)
    -            updatedStatus = appRuntimeInfo.onFinalStatus(timeStamp, failed)
    -            appResultListeners.getOrElse(appId, List.empty).foreach{ client =>
    -              client ! ApplicationFailed(appId, error)
    -            }
    -          case terminated@ApplicationStatus.TERMINATED =>
    -            updatedStatus = appRuntimeInfo.onFinalStatus(timeStamp, terminated)
    -          case status =>
    -            LOG.error(s"App $appId should not change it's status to $status")
    -        }
    +        // A dead application should not be able to update status
    +        if (!appRuntimeInfo.status.isInstanceOf[ApplicationTerminalStatus]) {
    --- End diff --
    
    Do we want to update status if not changed ? Can there be other "false alarm"s ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message