Serve only one request and garbage collect (#1978)

Adding once only execution pattern to pool manager based functions. This is for use cases where you don't want to share the samne pod for another execution instance!
This commit is contained in:
Rahul Bhati
2021-05-19 22:48:49 +05:30
committed by GitHub
parent c37b85b133
commit 1ff8711fcb
8 changed files with 20 additions and 2 deletions
+2 -2
View File
@@ -56,7 +56,7 @@ func (executor *Executor) getServiceForFunctionAPI(w http.ResponseWriter, r *htt
executor.logger.Debug("checking for cached function service",
zap.String("function_name", fn.ObjectMeta.Name),
zap.String("function_namespace", fn.ObjectMeta.Namespace))
if t == fv1.ExecutorTypePoolmgr {
if t == fv1.ExecutorTypePoolmgr && !fn.Spec.OnceOnly {
concurrency := fn.Spec.Concurrency
if concurrency == 0 {
concurrency = 500
@@ -90,7 +90,7 @@ func (executor *Executor) getServiceForFunctionAPI(w http.ResponseWriter, r *htt
http.Error(w, errMsg, http.StatusTooManyRequests)
return
}
} else {
} else if t == fv1.ExecutorTypeNewdeploy {
fsvc, err := et.GetFuncSvcFromCache(fn)
if err == nil {
if et.IsValid(fsvc) {