-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cherry pick upstream fix to memorize tsdb client #112
Conversation
…thanos-io#7941) * [Receive] fix race condition Signed-off-by: Yi Jin <[email protected]> * add a change log Signed-off-by: Yi Jin <[email protected]> * memorize tsdb local clients without race condition Signed-off-by: Yi Jin <[email protected]> * fix data race in testing with some concurrent safe helper functions Signed-off-by: Yi Jin <[email protected]> * address comments Signed-off-by: Yi Jin <[email protected]> --------- Signed-off-by: Yi Jin <[email protected]>
Signed-off-by: Yi Jin <[email protected]>
tenants := make([]string, 0, len(t.tenants)) | ||
for tname := range t.tenants { | ||
tenants = append(tenants, tname) | ||
} | ||
defer t.mtx.RUnlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha, found a potential bug cc @yuchen-db, you should defer Unlock right after, otherwise if there is a return statement in between, the lock won't be released ever.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
@@ -1215,74 +1215,3 @@ func TestReceiveCpnp(t *testing.T) { | |||
}, v) | |||
|
|||
} | |||
|
|||
func TestNewTenant(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this test introduced in #100 which didn't capture the bug anyway
tenants := make([]string, 0, len(t.tenants)) | ||
for tname := range t.tenants { | ||
tenants = append(tenants, tname) | ||
} | ||
defer t.mtx.RUnlock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks
GetTenants
Changes
Verification