Repository navigation
Return log store errors to the agent, except for duplicate entries - #7501
Merged
Merged
Conversation
Member
|
ci fails ... |
Contributor
Author
|
Thanks. It was cspell on the word "resends" in a comment; reworded in 85c4b28. Lint and tests were green. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7501 +/- ##
==========================================
+ Coverage 66.07% 66.09% +0.02%
==========================================
Files 449 449
Lines 22388 22391 +3
==========================================
+ Hits 14792 14800 +8
+ Misses 7596 7591 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
6543
approved these changes
Nov 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7085
This follows the shape suggested in #7085 (comment): only a duplicate insert error is dropped, everything else goes back to the agent as before #7004.
RPC.Logreturns theLogAppenderror unless it istypes.ErrInsertDuplicateDetected(entries resent after a retry, rejected by the unique index from Enforce one log entry per line with a unique index #7004).WoodpeckerServer.Logno longer discards the error of every step run but the last in a request. It returns them joined witherrors.Join.TestLogAppendRejectsResentEntriesnow assertsErrorIs(..., types.ErrInsertDuplicateDetected), sinceRPC.Logrelies on that.Not changed: the agent still treats these errors as permanent (
codes.Unknown), so it logs them and drops the batch. The loss is visible now but not retried. I left retry classification and the "lines lost" marker out, since they weren't agreed in the issue.Two cases worth knowing:
datastore.LogAppendjoins one error per chunk. If a single request spans several chunks and one is a duplicate while another fails for a real reason,errors.Ismatches the duplicate and the request is still treated as stored. I kept the check simple rather than walking the joined errors. Happy to change it if you'd rather cover that.Tests:
go test -race ./server/rpc/ ./server/store/datastore/, andgolangci-lintv2.15.0 on both packages.TestRPCLogAppendError/store_error_is_returnedandTestServerLogReportsEveryStepErrorfail on main.