Executor: Dump function service cache for pool manager functions (#2789)
* dump function service cache for executor * fix lint issue * code refactor and lint fixes --------- Signed-off-by: Shubham Bansal <shubhambansaliimtgn@gmail.com> Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> Co-authored-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
co-authored by
Sanket Sudake
parent
6c431e4d9b
commit
f99f10134c
@@ -35,6 +35,10 @@ import (
|
||||
"github.com/fission/fission/pkg/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
dumpFileName string = "fission-dump"
|
||||
)
|
||||
|
||||
// ApplyImagePullSecret applies image pull secret to the give pod spec.
|
||||
// It's intentional not to check the existence of secret here.
|
||||
// First, Kubernetes will set Pod status to "ImagePullBackOff" once
|
||||
@@ -152,3 +156,11 @@ func GetObjectReaperInterval(logger *zap.Logger, executorType fv1.ExecutorType,
|
||||
func getExecutorEnvVarName(executor fv1.ExecutorType) string {
|
||||
return strings.ToUpper(string(executor)) + "_OBJECT_REAPER_INTERVAL"
|
||||
}
|
||||
|
||||
// CreateDumpFile => create dump file inside temp directory
|
||||
func CreateDumpFile(logger *zap.Logger) (*os.File, error) {
|
||||
dumpPath := os.TempDir()
|
||||
logger.Info("creating dump file", zap.String("dump_path", dumpPath))
|
||||
|
||||
return os.Create(fmt.Sprintf("%s/%s-%d.txt", dumpPath, dumpFileName, time.Now().Unix()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user