fix(pipeline): harden upstream resilience and production shutdown

DoH через DoWithRetry; CDN preview через UpstreamHTTPDo; частичный fail CDN (EVOBGP_CDN_PARTIAL_OK); безопасный доступ к Job.Meta; drain jobs при SIGTERM; ValidateProductionEnforce при EVOBGP_PRODUCTION=1.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Denozordec
2026-07-31 12:11:52 +07:00
co-authored by Cursor
parent 1e04e91dd8
commit 53ce80c9ff
14 changed files with 228 additions and 16 deletions
+10
View File
@@ -3,6 +3,7 @@ package pipeline
import (
"context"
"fmt"
"log"
"net/http"
"os"
"strings"
@@ -218,12 +219,21 @@ func collectCDNPrefixRows(ctx context.Context, st store.Backend, hc *http.Client
wg.Wait()
var out []store.PrefixRow
var skipped int
for _, r := range results {
if r.err != nil {
if cdnPartialOK() {
log.Printf("pipeline: CDN partial skip source error: %v", r.err)
skipped++
continue
}
return nil, r.err
}
out = append(out, r.rows...)
}
if skipped > 0 && len(out) == 0 && len(valid) > 0 {
return nil, fmt.Errorf("cdn: all %d source(s) failed (partial ok)", len(valid))
}
if len(valid) > 0 {
if err := mergeAllCDNSourcesIntoModuleSnapshot(st, tenantID, mod, priorSnapshot, out); err != nil {
return nil, err