fix(agent): recover OpenResty runtime after invalid PID (#45)

* fix(agent): recover OpenResty runtime after invalid PID

* fix(agent): scope OpenResty shutdown to instance processes

---------

Co-authored-by: Noru Wyrms <wyrmsnoru@gmail.com>
This commit is contained in:
Ryan
2026-10-08 08:39:40 +08:00
committed by GitHub
parent fec9bd18dd
commit 96a17ae35d
15 changed files with 1000 additions and 91 deletions
+2 -2
View File
@@ -193,7 +193,7 @@ func (s *Service) applyRenderedConfig(ctx context.Context, mode string, snapshot
}
if !shouldReportApplyLog(alreadySynced, applyResult.reportResult) {
slog.Debug("skipping duplicate apply log report", "version", config.Version, "checksum", config.Checksum, "result", applyResult.reportResult)
if applyResult.reportResult == ApplyResultFailed {
if applyResult.reportResult != ApplyResultSuccess {
return outcomeError(config.Version, applyResult.message)
}
if err := s.syncReferencedWAFIPGroups(ctx, rendered.supportFiles); err != nil {
@@ -215,7 +215,7 @@ func (s *Service) applyRenderedConfig(ctx context.Context, mode string, snapshot
slog.Error("report apply log failed", "version", config.Version, "result", applyResult.reportResult, "error", err)
return err
}
if applyResult.reportResult == ApplyResultFailed {
if applyResult.reportResult != ApplyResultSuccess {
slog.Warn("failed apply log reported", "version", config.Version)
return outcomeError(config.Version, applyResult.message)
}