Skip to content

[1/2] chipingress: add ErrorCodeFor for partial delivery error classification#2274

Merged
pavel-raykov merged 1 commit into
mainfrom
chipingress-partial-delivery-cl-nodes
Jul 24, 2026
Merged

[1/2] chipingress: add ErrorCodeFor for partial delivery error classification#2274
pavel-raykov merged 1 commit into
mainfrom
chipingress-partial-delivery-cl-nodes

Conversation

@pkcll

@pkcll pkcll commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Adds batch.ErrorCodeFor to classify batch send/queue errors into bounded error_code strings, exports ErrMessageBufferFull and ErrClientShutdown sentinels, and handles the synthetic ErrCodeResultsMismatch (-1) explicitly as results_mismatch.\n\nThe beholder consumer lives in #2266.

…y metrics

Add batch.ErrorCodeFor to classify send/queue errors into bounded error_code strings.\nExport ErrMessageBufferFull and ErrClientShutdown sentinels.\nHandle synthetic ErrCodeResultsMismatch (-1) explicitly as 'results_mismatch'.
@pkcll
pkcll requested a review from a team as a code owner July 22, 2026 15:30
Copilot AI review requested due to automatic review settings July 22, 2026 15:30
@github-actions

Copy link
Copy Markdown
Contributor

👋 pkcll, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions

Copy link
Copy Markdown
Contributor

✅ API Diff Results - github.com/smartcontractkit/chainlink-common/pkg/chipingress

✅ Compatible Changes (3)

batch (3)
  • ErrClientShutdown — ➕ Added

  • ErrMessageBufferFull — ➕ Added

  • ErrorCodeFor — ➕ Added


📄 View full apidiff report

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a small error-classification helper to the chip ingress batch client so batch send/queue failures can be mapped to bounded error_code strings for metrics/log enrichment, including explicit handling of the synthetic ErrCodeResultsMismatch publish error code.

Changes:

  • Introduces batch.ErrorCodeFor(err) to map send/queue errors (publish errors, gRPC status codes, context cancellation/timeouts, and internal client sentinels) into bounded strings.
  • Exports ErrMessageBufferFull and ErrClientShutdown sentinels and updates QueueMessage to return them instead of allocating new errors.
  • Adds unit tests covering the new classification behavior.

Reviewed changes

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

File Description
pkg/chipingress/batch/client.go Adds ErrorCodeFor, exports sentinels, and updates queue error returns to use them.
pkg/chipingress/batch/client_test.go Adds test coverage for ErrorCodeFor classifications.

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

Comment on lines +82 to +84
if st, ok := status.FromError(err); ok {
return st.Code().String()
}
Comment on lines +76 to +81
if errors.Is(err, ErrMessageBufferFull) {
return ErrMessageBufferFull.Error()
}
if errors.Is(err, ErrClientShutdown) {
return ErrClientShutdown.Error()
}
@pavel-raykov
pavel-raykov added this pull request to the merge queue Jul 24, 2026
Merged via the queue into main with commit 45996a1 Jul 24, 2026
32 of 33 checks passed
@pavel-raykov
pavel-raykov deleted the chipingress-partial-delivery-cl-nodes branch July 24, 2026 14:38
pkcll added a commit that referenced this pull request Jul 24, 2026
Updates the root go.mod/go.sum to use the merged main commit of the chipingress submodule.\nThis resolves the dependency validation failure that required chipingress pseudo-versions to exist on main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants