fix: keep schedulers alive without metrics
This commit is contained in:
@@ -119,7 +119,9 @@ func run() error {
|
||||
call, cancel := context.WithTimeout(workflowCtx, 5*time.Second)
|
||||
_, err := workflows.Tick(call, 100)
|
||||
cancel()
|
||||
metrics.RecordBatch("workflow", started, err)
|
||||
if metrics != nil {
|
||||
metrics.RecordBatch("workflow", started, err)
|
||||
}
|
||||
if err != nil && workflowCtx.Err() == nil {
|
||||
slog.Error("workflow batch failed", "node_id", node)
|
||||
}
|
||||
@@ -142,7 +144,9 @@ func run() error {
|
||||
call, cancel := context.WithTimeout(scheduleCtx, 5*time.Second)
|
||||
_, err := schedules.Tick(call, 100)
|
||||
cancel()
|
||||
metrics.RecordBatch("schedule", started, err)
|
||||
if metrics != nil {
|
||||
metrics.RecordBatch("schedule", started, err)
|
||||
}
|
||||
if err != nil && scheduleCtx.Err() == nil {
|
||||
slog.Error("schedule batch failed", "node_id", node)
|
||||
}
|
||||
@@ -170,7 +174,9 @@ func run() error {
|
||||
call, cancel := context.WithTimeout(recoveryCtx, 5*time.Second)
|
||||
_, err := executions.Recover(call, 100)
|
||||
cancel()
|
||||
metrics.RecordBatch("execution_recovery", started, err)
|
||||
if metrics != nil {
|
||||
metrics.RecordBatch("execution_recovery", started, err)
|
||||
}
|
||||
if err != nil && recoveryCtx.Err() == nil {
|
||||
slog.Error("execution recovery batch failed", "node_id", node)
|
||||
}
|
||||
|
||||
@@ -135,6 +135,13 @@ func TestIntegrationMetricsProcess(t *testing.T) {
|
||||
} else if metrics != "" {
|
||||
t.Fatal("disabled metrics listener was started")
|
||||
}
|
||||
if !enabled {
|
||||
select {
|
||||
case <-done:
|
||||
t.Fatal("server exited after metrics was disabled")
|
||||
case <-time.After(2200 * time.Millisecond):
|
||||
}
|
||||
}
|
||||
if err := cmd.Process.Signal(syscall.SIGTERM); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user