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 [email protected] =>
- killAppMaster(appId, appRuntimeInfo.worker)
- updatedStatus = appRuntimeInfo.onFinalStatus(timeStamp,
succeeded)
- appResultListeners.getOrElse(appId, List.empty).foreach{
client =>
- client ! ApplicationSucceeded(appId)
- }
- case [email protected] =>
- killAppMaster(appId, appRuntimeInfo.worker)
- updatedStatus = appRuntimeInfo.onFinalStatus(timeStamp, failed)
- appResultListeners.getOrElse(appId, List.empty).foreach{
client =>
- client ! ApplicationFailed(appId, error)
- }
- case [email protected] =>
- 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 [email protected] or file a JIRA ticket
with INFRA.
---