Skip to content

tsdb/wlog: small cleanup of WAL watcher after #13583#13628

Merged
bboreham merged 3 commits intoprometheus:mainfrom
bboreham:cleanup-13583
Feb 23, 2024
Merged

tsdb/wlog: small cleanup of WAL watcher after #13583#13628
bboreham merged 3 commits intoprometheus:mainfrom
bboreham:cleanup-13583

Conversation

@bboreham
Copy link
Copy Markdown
Member

  • Remove unnecessary sleep check - Sleep() is documented to return immediately on negative or zero input.
  • Clean up debug messages - print lastSegment after it gets initialized, move variable declaration to first use.
  • Improve comments:
    • Clarify in the first comment that it is watch() that waits, and reduce verbiage.
    • The second comment was slightly contradictory to the first and otherwise
      didn't seem to add much, since currentSegment was incremented just a
      few lines later.

Sleep() is documented to return immediately on negative or zero input.

Signed-off-by: Bryan Boreham <[email protected]>
Print lastSegment after it gets initialized.

Move variable declaration to first use.

Signed-off-by: Bryan Boreham <[email protected]>
Clarify in the first comment that it is `watch()` that waits, and reduce
verbiage.

The second comment was slightly contradictory to the first and otherwise
didn't seem to add much, since `currentSegment` was incremented just a
few lines later.

Signed-off-by: Bryan Boreham <[email protected]>
Copy link
Copy Markdown
Member

@cstyan cstyan left a comment

Choose a reason for hiding this comment

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

Thanks for the follow up 👍

@bboreham bboreham merged commit 4d6bb2e into prometheus:main Feb 23, 2024
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.

2 participants