Skip to content

reconciler: fix inverted log message and level for UpdateNotReadyErr#3871

Open
emmahone wants to merge 1 commit into
operator-framework:masterfrom
emmahone:fix/update-pod-not-ready-log-inversion
Open

reconciler: fix inverted log message and level for UpdateNotReadyErr#3871
emmahone wants to merge 1 commit into
operator-framework:masterfrom
emmahone:fix/update-pod-not-ready-log-inversion

Conversation

@emmahone

Copy link
Copy Markdown

Description of the change:

When ensureUpdatePod returns UpdateNotReadyErr — the expected, benign signal that a new update pod hasn't yet reported ready — EnsureRegistryServer logged it at level=error with the message "ensure update pod error is not of type UpdateNotReadyErr". The ok branch fires precisely when the error is UpdateNotReadyErr, so the message was the exact opposite of what happened.

Motivation for the change:

This mislabeled error was observed flooding logs in production environments where catalog registry pods have long startup times. Every reconcile tick during pod startup hit this path, producing a steady stream of misleading level=error messages that appeared to indicate a failed type-assertion, when the actual state was a completely normal pod-not-ready wait. This made triage and support significantly harder.

Architectural changes:

None. Control flow is unchanged — UpdateNotReadyErr is still returned as-is; only the log message and severity are corrected.

Testing remarks:

Added a regression unit test Grpc/PollingEnabled/UpdatePodNotReady/ReturnsUpdateNotReadyErr in grpc_test.go that verifies EnsureRegistryServer returns UpdateNotReadyErr (unmodified, not wrapped) when polling is enabled and an update pod exists but has not yet reported ready. All existing tests continue to pass.

When ensureUpdatePod returns UpdateNotReadyErr (the expected, benign
signal that a new update pod has not yet reported ready), EnsureRegistryServer
logged the error at level=error with the message "ensure update pod error
is not of type UpdateNotReadyErr" — the exact opposite of what happened.

The ok branch fires precisely when the error IS UpdateNotReadyErr, so
the message was backwards. Additionally, logging a normal pod-startup wait
at error level contributed to spurious error floods in environments where
registry pods have long startup times.

This commit:
- Checks for UpdateNotReadyErr before the generic error log, so the
  benign case never fires at level=error.
- Corrects the log message to "update pod not yet ready".
- Downgrades the log to Debug, since this is an expected polling state.
- Adds a regression unit test verifying EnsureRegistryServer returns
  UpdateNotReadyErr (unmodified) when a not-ready update pod is present.
Copilot AI review requested due to automatic review settings July 20, 2026 21:54
@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 20, 2026
@openshift-ci

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown

Hi @emmahone. Thanks for your PR.

I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci
openshift-ci Bot requested review from oceanc80 and tmshort July 20, 2026 21:55
@openshift-ci

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign pedjak for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR corrects misleading logging in the gRPC registry reconciler when ensureUpdatePod returns the expected UpdateNotReadyErr during catalog polling, reducing noisy/error-level logs during normal update-pod startup behavior.

Changes:

  • Adjust log severity/message for UpdateNotReadyErr from Error with an inverted message to a Debug message indicating the update pod is not yet ready.
  • Add a regression unit test covering the polling-enabled “update pod exists but not ready” path and asserting UpdateNotReadyErr is returned unwrapped.
  • Introduce a small test helper to create a polling-enabled CatalogSource.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/controller/registry/reconciler/grpc.go Fixes log level/message for the benign UpdateNotReadyErr path in EnsureRegistryServer.
pkg/controller/registry/reconciler/grpc_test.go Adds regression coverage to ensure UpdateNotReadyErr is returned as-is when polling is enabled and the update pod isn’t ready.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -340,11 +340,11 @@ func (c *GrpcRegistryReconciler) EnsureRegistryServer(logger *logrus.Entry, cata
return pkgerrors.Wrapf(err, "error ensuring pod: %s", pod.GetName())
return err
}
logger.WithError(err).Error("error ensuring registry server: could not ensure update pod")
return pkgerrors.Wrapf(err, "error ensuring updated catalog source pod: %s", pod.GetName())
@grokspawn

Copy link
Copy Markdown
Contributor

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants