Commit e54894f

Eric Bower  ·  2026-08-27 11:12:32 -0400 EDT
parent b953e91
fix: remove gc from monitor

it just keeps deleting my sessions
1 files changed,  +1, -19
+1, -19
......@@ -72,7 +72,6 @@ type Cfg struct {
7272 Event string // event JSON passed via --event flag
7373 EventSource io.ReadCloser // when set, used directly as the event source (for testing)
7474 MonitorInterval time.Duration
75- GCInterval time.Duration
7675 NewWorkspace WorkspaceFactory
7776 StatusOutput io.Writer // where status JSONL is written (default: os.Stdout)
7877 IncludeRunning bool // emit running status updates in addition to terminal
......@@ -111,7 +110,6 @@ type Event struct {
111110 func NewCfg() (*Cfg, string, bool) {
112111 var keyLoc, certLoc, artifactDir, event string
113112 var monitorInterval time.Duration
114- var gcInterval time.Duration
115113 var logLevel string
116114 var envVars envList
117115 var sessionPrefix string
......@@ -122,7 +120,6 @@ func NewCfg() (*Cfg, string, bool) {
122120 flag.StringVar(&event, "event", "", "event JSON to run (alternative to reading from stdin)")
123121 flag.StringVar(&sessionPrefix, "prefix", "ci.", "session prefix filter for monitor (default: ci.)")
124122 flag.DurationVar(&monitorInterval, "monitor-interval", 5*time.Second, "interval for monitoring zmx sessions")
125- flag.DurationVar(&gcInterval, "gc-interval", 10*time.Minute, "interval for garbage collection in monitor (0 to disable)")
126123 flag.StringVar(&logLevel, "log-level", "info", "log level: debug, info, warn, error")
127124 flag.Var(&envVars, "e", "environment variable in KEY=VAL format (can be specified multiple times)")
128125 flag.Var(&envVars, "env", "environment variable in KEY=VAL format (can be specified multiple times)")
......@@ -170,7 +167,6 @@ func NewCfg() (*Cfg, string, bool) {
170167 ArtifactDir: artifactDir,
171168 Event: event,
172169 MonitorInterval: monitorInterval,
173- GCInterval: gcInterval,
174170 IncludeRunning: includeRunning,
175171 HumanOutput: human,
176172 Wait: wait,
......@@ -460,7 +456,6 @@ FLAGS
460456 -ck <path> SSH certificate public key
461457 -artifact-dir <path> Local directory to stage artifacts (default: /tmp/pici-artifacts)
462458 -monitor-interval <dur> Poll interval (default: 5s)
463- -gc-interval <dur> Garbage collection interval (default: 10m, 0 to disable)
464459 -include-running Emit running status updates in addition to terminal (default: terminal only)
465460 -human Human-readable output instead of JSONL (for terminal, not piping)
466461 -log-level <level> Log level: debug, info, warn, error (default: info)`)
......@@ -1175,18 +1170,10 @@ func runMonitor(cfg *Cfg) error {
11751170 ticker := time.NewTicker(cfg.MonitorInterval)
11761171 defer ticker.Stop()
11771172
1178- // Optional GC ticker — runs garbage collection on a separate interval.
1179- var gcChan <-chan time.Time
1180- if cfg.GCInterval > 0 {
1181- gcTicker := time.NewTicker(cfg.GCInterval)
1182- defer gcTicker.Stop()
1183- gcChan = gcTicker.C
1184- }
1185-
11861173 // Track per-job display state across ticks (for human output)
11871174 jobStates := make(map[string]*monitorJobState) // key: "name/jobID"
11881175
1189- log.Debug("monitor started", "interval", cfg.MonitorInterval, "gc_interval", cfg.GCInterval, "artifact_dir", cfg.ArtifactDir)
1176+ log.Debug("monitor started", "interval", cfg.MonitorInterval, "artifact_dir", cfg.ArtifactDir)
11901177 log.Debug("monitoring ci.* sessions for job status, writing status to stdout")
11911178
11921179 for {
......@@ -1198,11 +1185,6 @@ func runMonitor(cfg *Cfg) error {
11981185 if err := monitorTick(cfg, log, output, jobStates); err != nil {
11991186 log.Error("monitor tick", "err", err)
12001187 }
1201- case <-gcChan:
1202- log.Debug("running periodic garbage collection")
1203- if err := runGC(cfg); err != nil {
1204- log.Error("periodic gc", "err", err)
1205- }
12061188 }
12071189 }
12081190 }