Fix map read error translation and config validation - #1178
Merged
Merged
Conversation
MapReadState and MapReadStream mapped every node error to ErrorInternal, unlike History which translates centrifuge.ErrorUnrecoverablePosition to the code-112 API error. The map read paths return ErrorUnrecoverablePosition on epoch mismatch / trimmed stream, so a client paginating a map stream past a trimmed point (or reading state with a stale revision epoch) got a 100 internal error instead of 112, its recovery logic never fired, and a normal recovery event was logged as a server fault. Translate it like History does.
Two validation bugs:
- validateCodeToUniDisconnectTransforms used errors.New with a %d directive for
the two to.* checks, so the index was emitted literally ("transforms[%d].to")
instead of substituted; the sibling checks already use fmt.Errorf. Use
fmt.Errorf with the loop index.
- The h2c_external check only rejected when the external port equaled a non-empty
internal_port, so enabling h2c_external with internal_port left at its default
(empty) passed validation - but at runtime internal falls back to the external
port, applying h2c to the shared server, exactly the setup the check forbids.
Also reject when internal_port is empty.
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.
Correctness fixes.
Fixes
fmt.Errorfargs in transform error messages, and correct theh2c_externalcheck when the internal port is empty.