Skip to content

Commit

Permalink
Runtime: change reconcile and parse errors to warns (#3691)
Browse files Browse the repository at this point in the history
* Runtime: Refactor conn cache to contain and detect hanging opens/closes

* Extract connection cache to pkg + use a singleflight

* Add tests

* Runtime: change reconcile and parse errors to warns
  • Loading branch information
begelundmuller authored Dec 15, 2023
1 parent fa2e166 commit 50b4e2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions runtime/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ func (c *Controller) markPending(n *runtimev1.ResourceName) (skip bool, err erro
}
if !r.Meta.Hidden {
logArgs := []any{slog.String("name", n.Name), slog.String("kind", unqualifiedKind(n.Kind)), slog.Any("error", errCyclicDependency)}
c.Logger.Error("Skipping resource", logArgs...)
c.Logger.Warn("Skipping resource", logArgs...)
}
return true, nil
}
Expand Down Expand Up @@ -1350,7 +1350,7 @@ func (c *Controller) processCompletedInvocation(inv *invocation) error {
errorLevel = true
}
if errorLevel {
c.Logger.Error("Reconcile failed", logArgs...)
c.Logger.Warn("Reconcile failed", logArgs...)
} else if !inv.isHidden {
c.Logger.Info("Reconciled resource", logArgs...)
}
Expand Down
6 changes: 3 additions & 3 deletions runtime/reconcilers/project_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,14 @@ func (r *ProjectParserReconciler) reconcileParser(ctx context.Context, inst *dri
if skipRillYAMLErr && e.FilePath == "/rill.yaml" {
continue
}
r.C.Logger.Error("Parser error", slog.String("path", e.FilePath), slog.String("err", e.Message))
r.C.Logger.Warn("Parser error", slog.String("path", e.FilePath), slog.String("err", e.Message))
}
} else if diff.Skipped {
r.C.Logger.Error("Not parsing changed paths due to broken rill.yaml")
r.C.Logger.Warn("Not parsing changed paths due to broken rill.yaml")
} else {
for _, e := range parser.Errors {
if slices.Contains(changedPaths, e.FilePath) {
r.C.Logger.Error("Parser error", slog.String("path", e.FilePath), slog.String("err", e.Message))
r.C.Logger.Warn("Parser error", slog.String("path", e.FilePath), slog.String("err", e.Message))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (r *registryCache) restartController(iwc *instanceWithController) {
r.logger.Info("syncing repo", zap.String("instance_id", iwc.instance.ID))
err := r.ensureRepoSync(iwc.ctx, iwc.instance.ID)
if err != nil {
r.logger.Error("failed to sync repo", zap.String("instance_id", iwc.instance.ID), zap.Error(err))
r.logger.Warn("failed to sync repo", zap.String("instance_id", iwc.instance.ID), zap.Error(err))
// Even if repo sync failed, we'll start the controller
} else {
r.logger.Info("repo synced", zap.String("instance_id", iwc.instance.ID))
Expand Down

0 comments on commit 50b4e2b

Please sign in to comment.