Fix poolmanager terminates running function pod periodically (#1435)

The pool manager keeps terminating function pod periodically even there are
traffic to the function. The root cause is that executor, poolmgr, newdeploy
manage their own functionServiceCache separately. And when router taps a
function, executor updates the access time of the function service entry in its
own cache without notifying executor types to do the update as well. Hence,
the access time of function service entry in poolmanager cache never gets updated.
Due to the access time never gets updated, the idle pod reaper in poolmanager
then thinks the function pod is in idle state and recycle it.

This PR removes the cache in executor itself, and when router tries to tap a function,
executor will call executor type to tap the function and update access time.
This commit is contained in:
Ta-Ching Chen
2019-11-26 01:16:30 +08:00
committed by GitHub
parent 6d2fe08973
commit 51b264e8ca
19 changed files with 371 additions and 287 deletions
+3 -7
View File
@@ -33,7 +33,8 @@ import (
)
type fscRequestType int
type executorType int
//type executorType int
const (
TOUCH fscRequestType = iota
@@ -41,11 +42,6 @@ const (
LOG
)
const (
POOLMGR executorType = iota
NEWDEPLOY
)
type (
FuncSvc struct {
Name string // Name of object
@@ -53,7 +49,7 @@ type (
Environment *fv1.Environment // function's environment
Address string // Host:Port or IP:Port that the function's service can be reached at.
KubernetesObjects []apiv1.ObjectReference // Kubernetes Objects (within the function namespace)
Executor executorType
Executor fv1.ExecutorType
Ctime time.Time
Atime time.Time