Repository navigation
fix: leave worker registry unchanged on alias collision - #1440
Merged
Merged
Conversation
Contributor
|
@flcrom Do you want to add yourself to the River CLA https://github.com/riverqueue/rivercla? And add a changelog entry for this as well please. |
Contributor
Author
|
CLA is already signed: I'm in signees.csv in riverqueue/rivercla (riverqueue/rivercla#37). Changelog entry added in 3f38b47. |
Produces a net reduction in LOCs (-15 lines) for `Workers.add`.
brandur
approved these changes
Oct 10, 2026
Contributor
|
@flcrom Ah perfect. Thanks again! |
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.
Fixes #1433.
Workers.addcurrently writes the primary kind and earlier aliases before checking later aliases. When a later alias is already registered,AddWorkerSafelyreturns an error but leaves those new kinds in the registry, preventing a caller from registering replacement workers.Collect and validate every kind before writing to the map. Keep the existing collision error text and rejection of duplicate kinds within a registration. Add a regression for a late alias collision that checks the registry size and absence of the candidate primary kind and earlier alias.
Validation:
make test, PostgreSQL and SQLitemake test/race, andmake lintpass across all nine workspace modules. Lint used v2.13.1 with concurrency=1 for local memory limits.Local testing used Go 1.26.6 and PostgreSQL 14.24 with UTF8. This does not claim every upstream CI OS/Go/database combination has passed. No registration-after-start behavior is changed.