Skip to content
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

De-flake TestJetStreamClusterMirrorAndSourceExpiration #6304

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

MauriceVanVeen
Copy link
Member

nextTTL was not defaulted to math.MaxInt64 so it would not cancel the age check in this condition: if fs.state.Msgs == 0 && nextTTL == math.MaxInt64.

Signed-off-by: Maurice van Veen [email protected]

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner December 27, 2024 11:29
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -5317,7 +5317,7 @@ func (fs *fileStore) expireMsgs() {
defer fs.mu.Unlock()

// TODO: Not great that we're holding the lock here, but the timed hash wheel isn't thread-safe.
var nextTTL int64
nextTTL := int64(math.MaxInt64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was wondering if

var nextTTL int64 = math.MaxInt64

is better, but I think your variant is shorter and more idiomatic.

@derekcollison derekcollison merged commit cee44be into main Dec 27, 2024
5 checks passed
@derekcollison derekcollison deleted the maurice/de-flake-mirror-source-expire branch December 27, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants