-
Notifications
You must be signed in to change notification settings - Fork 911
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
log error when ReadEntryProcessor IOException #4199
base: master
Are you sure you want to change the base?
Conversation
if (LOG.isDebugEnabled()) { | ||
LOG.debug("Error reading {}", request, e); | ||
} | ||
LOG.error("IOException while reading {}", request, e); |
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.
I believe this would print the whole stack trace every time a client gets a connectivity error with any bookie, for each entry that we're trying to read.
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.
whole stack trace every time a client gets a connectivity error with any bookie
Thanks for your review @merlimat . But I don't get your point. This method runs only on serever side and probability throw IOException
if read an entry from storage. So I think it doesn't matter with client print logs
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.
Pring ledgerId:entryId
instead of the whole request content?
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.
I think print whole request
is OK. because ReadRequest
has overwrite the toString
method:
bookkeeper/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieProtocol.java
Lines 249 to 251 in 34bd4b3
public String toString() { | |
return String.format("Op(%d)[Ledger:%d,Entry:%d]", opCode, ledgerId, entryId); | |
} |
@hangc0276
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.
I believe this would print the whole stack trace every time a client gets a connectivity error with any bookie, for each entry that we're trying to read.
If the target entry does not exist on the bookie, it will throw NoLedgerException or NoEntryException and won't go into this code path. @merlimat Do you have any concern?
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.
I believe this would print the whole stack trace every time a client gets a connectivity error with any bookie, for each entry that we're trying to read.
If the target entry does not exist on the bookie, it will throw NoLedgerException or NoEntryException and won't go into this code path. @merlimat Do you have any concern?
The NoLedgerException and NoEntryException extend IOException, it should be caught.
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.
Overall LGTM.
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.
LGTM.
@merlimat Could you please take a look again? |
Descriptions of the changes in this PR:
Motivation
Change the log-level to error when
ReadEntryProcessor
throwIOException
. The reason is that:IOException
should not happen frequently,so the error log will not print too muchReadEntryProcessorV3
has printed the error logbookkeeper/bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/ReadEntryProcessorV3.java
Lines 233 to 236 in dc2bb1d
Changes
log.debug
->log.error