cli icon indicating copy to clipboard operation
cli copied to clipboard

Fix `fialed to watch` context canceled error when streaming logs

Open pratap0007 opened this issue 1 month ago • 3 comments

When streaming pipelineRun or taskRun logs, closing the stop channel to terminate the informer was causing "Failed to watch" error messages to be logged with "context canceled". This was noisy and confusing for users even though it was expected behavior during intentional shutdown.

This patch add custom watchErrorHandler function that filter out context.Canceled errors while passing other errors to the default handler. This prevents the error log messages when the CLI intentionally stops watching after a run completes.

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you review them:

  • [ ] Includes tests (if functionality changed/added)
  • [ ] Run the code checkers with make check
  • [ ] Regenerate the manpages, docs and go formatting with make generated
  • [ ] Commit messages follow commit message best practices

See the contribution guide for more details.

Release Notes

Fix `fialed to watch` context canceled error when streaming logs

pratap0007 avatar Dec 09 '25 16:12 pratap0007

/retest

pratap0007 avatar Dec 11 '25 04:12 pratap0007

cc: @divyansh42

pratap0007 avatar Dec 16 '25 07:12 pratap0007

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: divyansh42 To complete the pull request process, please ask for approval from pratap0007 after the PR has been reviewed.

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

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

tekton-robot avatar Dec 22 '25 07:12 tekton-robot