fix: ExpiryReaper orphan race + nodejs ESM entrypoint (v1.3.93)
This commit is contained in:
@@ -58,7 +58,7 @@ spec:
|
|||||||
serviceAccountName: fission-console
|
serviceAccountName: fission-console
|
||||||
containers:
|
containers:
|
||||||
- name: console
|
- name: console
|
||||||
image: naeel/fission-console:v1.3.92
|
image: naeel/fission-console:v1.3.93
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8090
|
- containerPort: 8090
|
||||||
|
|||||||
@@ -393,7 +393,17 @@ func (m *NSManager) reapExpiredFunctionsInNS(ctx context.Context, ns string, now
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Orphan packages — пакеты без соответствующей функции
|
// Orphan packages — пакеты без соответствующей функции.
|
||||||
|
// Перечитываем Functions заново (fresh LIST) чтобы избежать race condition:
|
||||||
|
// новая функция может быть создана между снятием activeFunctions и этой проверкой.
|
||||||
|
freshFunctions, freshErr := m.dyn.Resource(fission.FunctionGVR).Namespace(ns).List(ctx, metav1.ListOptions{})
|
||||||
|
if freshErr != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
freshFunctionSet := make(map[string]struct{}, len(freshFunctions.Items))
|
||||||
|
for _, fn := range freshFunctions.Items {
|
||||||
|
freshFunctionSet[fn.GetName()] = struct{}{}
|
||||||
|
}
|
||||||
packages, pkgListErr := m.dyn.Resource(fission.PackageGVR).Namespace(ns).List(ctx, metav1.ListOptions{})
|
packages, pkgListErr := m.dyn.Resource(fission.PackageGVR).Namespace(ns).List(ctx, metav1.ListOptions{})
|
||||||
if pkgListErr == nil {
|
if pkgListErr == nil {
|
||||||
for _, pkg := range packages.Items {
|
for _, pkg := range packages.Items {
|
||||||
@@ -402,7 +412,7 @@ func (m *NSManager) reapExpiredFunctionsInNS(ctx context.Context, ns string, now
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fnName := strings.TrimSuffix(pkgName, "-pkg")
|
fnName := strings.TrimSuffix(pkgName, "-pkg")
|
||||||
if _, exists := activeFunctions[fnName]; !exists {
|
if _, exists := freshFunctionSet[fnName]; !exists {
|
||||||
log.Printf("cloud.ExpiryReaper: deleting orphan package %s/%s", ns, pkgName)
|
log.Printf("cloud.ExpiryReaper: deleting orphan package %s/%s", ns, pkgName)
|
||||||
_ = m.dyn.Resource(fission.PackageGVR).Namespace(ns).Delete(ctx, pkgName, metav1.DeleteOptions{})
|
_ = m.dyn.Resource(fission.PackageGVR).Namespace(ns).Delete(ctx, pkgName, metav1.DeleteOptions{})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ package runtime
|
|||||||
func DefaultEntrypoint(lang string) string {
|
func DefaultEntrypoint(lang string) string {
|
||||||
switch lang {
|
switch lang {
|
||||||
case "nodejs":
|
case "nodejs":
|
||||||
return "main"
|
// main.js — явное расширение нужно для ESM-loader в node-env
|
||||||
|
return "main.js"
|
||||||
case "php":
|
case "php":
|
||||||
// Fission php-env: filename::functionName
|
// Fission php-env: filename::functionName
|
||||||
return "main.php::handler"
|
return "main.php::handler"
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
<div class="nubes">NUBES</div>
|
<div class="nubes">NUBES</div>
|
||||||
<div class="product">FISSION CONSOLE</div>
|
<div class="product">FISSION CONSOLE</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size:0.65rem; color:var(--text-secondary); margin-left:10px; align-self:center; opacity:0.7;">v1.3.92</div>
|
<div style="font-size:0.65rem; color:var(--text-secondary); margin-left:10px; align-self:center; opacity:0.7;">v1.3.93</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" style="margin:0;">
|
<div class="row" style="margin:0;">
|
||||||
<button class="btn ghost" onclick="reloadAll()">Refresh</button>
|
<button class="btn ghost" onclick="reloadAll()">Refresh</button>
|
||||||
@@ -626,7 +626,7 @@ psycopg2-binary" style="width:100%; box-sizing:border-box; font-family:monospace
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions" style="justify-content:space-between; align-items:center;">
|
<div class="actions" style="justify-content:space-between; align-items:center;">
|
||||||
<span style="font-size:0.75rem; color:var(--text-secondary);">v1.3.92</span>
|
<span style="font-size:0.75rem; color:var(--text-secondary);">v1.3.93</span>
|
||||||
<button class="btn ghost" onclick="closeHelp()">Закрыть</button>
|
<button class="btn ghost" onclick="closeHelp()">Закрыть</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user