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

Disable annoying logs when segments is empty #4048

Merged
merged 1 commit into from
May 30, 2024

Conversation

mattisonchao
Copy link
Member

Motivation

I saw some logs print repeatedly.

2023-08-12T03:52:59,027+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,065+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,129+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,175+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,208+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,225+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,278+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,337+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,340+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,412+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,433+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,646+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,871+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,894+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,942+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:52:59,976+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:53:00,012+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:53:00,070+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:53:00,237+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:53:00,270+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []
2023-08-12T03:53:00,287+0000 [main-EventThread] INFO  org.apache.distributedlog.ReadAheadEntryReader - segments is updated with []

Changes

Return directly when segments are empty.

@mattisonchao
Copy link
Member Author

I am not familiar with this part. Please correct me If I do something wrong. :)

Copy link
Member

@zymap zymap left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1014,6 +1014,9 @@ public void onSegmentsUpdated(List<LogSegmentMetadata> segments) {
if (!started.get()) {
return;
}
if (segments == null || segments.isEmpty()) {
return;
}
logger.info("segments is updated with {}", segments);
processLogSegments(segments);
Copy link
Contributor

Choose a reason for hiding this comment

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

If we returned when the segments is empty, it will skip call processLogSegments(segments);, and I'm not sure what's the impact

Copy link
Contributor

Choose a reason for hiding this comment

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

processLogSegments seems to do nothing in case of empty segments List

Copy link
Contributor

@AnonHxy AnonHxy left a comment

Choose a reason for hiding this comment

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

LGTM

@eolivelli eolivelli modified the milestones: 4.17.0, 4.18.0 Mar 29, 2024
@dlg99
Copy link
Contributor

dlg99 commented May 30, 2024

re-triggering CI by close/open

@dlg99 dlg99 closed this May 30, 2024
@dlg99 dlg99 reopened this May 30, 2024
@dlg99 dlg99 merged commit f6f1623 into apache:master May 30, 2024
43 checks passed
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants