Skip to content

Commit

Permalink
MB-47445: Add to deployed apps if function state is paused
Browse files Browse the repository at this point in the history
When eventing producer crashes all the in-memory state of
a function is lost. So paused handler won't be added
to deployed apps. This will keep the state of paused app as
pausing. This patch will add it to deployed apps and deployment of
paused handler will be done lazily

Backport of MB-44335

Change-Id: I2edd55fbf0308e890955fde140996e0e8727f8ed
Reviewed-on: http://review.couchbase.org/c/eventing/+/146510
Reviewed-by: Jeelan Basha Poola <jeelan.poola@couchbase.com>
Reviewed-by: CI Bot
Tested-by: <ankit.prabhu@couchbase.com>
(cherry picked from commit 1a57b4a)
Reviewed-on: http://review.couchbase.org/c/eventing/+/157500
Well-Formed: Restriction Checker
Reviewed-by: <abhishek.jindal@couchbase.com>
  • Loading branch information
AnkitPrabhu authored and jeelanp2003 committed Jul 19, 2021
1 parent dc46fb8 commit c6f7e33
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions supervisor/super_supervisor.go
Expand Up @@ -345,6 +345,15 @@ func (s *SuperSupervisor) SettingsChangeCallback(path string, value []byte, rev
delete(s.pausingApps, appName)
s.appListRWMutex.Unlock()
logging.Infof("%s [%d] Function: %s pausing done", logPrefix, s.runningFnsCount(), appName)
} else {
// This can happen if eventing producer crashed and respawned
// Spawning of the producer happens lazily when user deploy this function
s.appRWMutex.Lock()
s.appDeploymentStatus[appName] = deploymentStatus
s.appProcessingStatus[appName] = processingStatus
s.appRWMutex.Unlock()
s.addToDeployedApps(appName)
s.addToLocallyDeployedApps(appName)
}
}

Expand Down

0 comments on commit c6f7e33

Please sign in to comment.