implement thread safe router#3358
Merged
Merged
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3358 +/- ##
==========================================
+ Coverage 59.06% 59.19% +0.12%
==========================================
Files 2098 2098
Lines 172968 172474 -494
==========================================
- Hits 102168 102092 -76
+ Misses 61933 61533 -400
+ Partials 8867 8849 -18
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
blindchaser
reviewed
May 1, 2026
| // TestInMemoryRouter is a [Router] backed by an in-memory map. The outer map keys | ||
| // are store (module) names and the inner map keys are store keys. It does not | ||
| // support iteration or proofs. | ||
| type TestInMemoryRouter struct { |
Contributor
There was a problem hiding this comment.
looks TestInMemoryRouter is named and documented as test infrastructure, but the file is not suffixed _test.go ?
Contributor
Author
There was a problem hiding this comment.
Renamed to migration_test_framework_test.go. Name is ugly, but I guess that's go convention. 🤷
blindchaser
reviewed
May 1, 2026
| // may run concurrently with one another. See [threadSafeRouter] for the | ||
| // full concurrency contract, including the iterator caveat. | ||
| func NewThreadSafeRouter(router Router) Router { | ||
| return &threadSafeRouter{inner: router} |
Contributor
There was a problem hiding this comment.
suggest add this to match NewModuleRouter and NewRoute
if router == nil {
return nil, fmt.Errorf("router must not be nil")
}
blindchaser
approved these changes
May 1, 2026
Kbhat1
approved these changes
May 4, 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.
Describe your changes and provide context
A wrapper implementation of
migration.Routerthat provides necessary thread safety for migration utilities. This was split out from a larger PR.Testing performed to validate your change
unit tests