-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
KAFKA-6415: Use WARN log level for Metadata in system test #4375
Conversation
@ijuma Can you review please? Thanks. |
Thanks @rajinisivaram. Did you consider increasing the log level of the log4j appender system test to |
@ijuma Thank you for the review. I wasn't sure if there could be users who were doing something similar with INFO level logs, so I thought it was safer to reduce the log level to debug for that particular entry. But if that is unlikely, then it would be better to change the system test. What do you think? |
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.
How about disable syncSend until we figure out the solution ?
Change looks good as workaround.
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.
We may not want to change logging level of specific code to make tests pass. Other log message can be added in future with a level which may fail the tests.
Agree with @tedyu on not setting syncSend as true because that seems to avoid deadlock scenario.
KafkaLog4jAppenderTest
has SyncSend as false. So this issue may not occur in that test.
VerifiableLog4jAppender
uses syncSend as false as here[1] which can be changed to false. Tests can be modified where this logger is used if it is required.
@satishd that option seems worse as we then don't test |
@ijuma Suggested solution was intended to be temporary. Your suggestion of having log level as warn in system tests as temporary solution makes sense as that also does not require the code to be changed and it covers SyncSend as true. |
9e6a42b
to
c6d3169
Compare
Thank you for the reviews and suggestions. I have updated the code to log just Metadata at WARN level in |
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 for the update. LGTM, assuming you have verified that the test now passes.
@ijuma Thank you for the review. Yes, I have verified that the system tests pass. Will wait for the builds to complete and then merge. |
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.
@rajinisivaram +1 LGTM, thanks for your changes.
retest this please |
When a log entry is appended to a Kafka topic using
KafkaLog4jAppender
, the producer.send operation may block waiting for metadata. This can result in deadlocks in a couple of scenarios if a log entry from the producer network thread is also at a log level that results in the entry being appended to a Kafka topic.KafkaLog4jAppender#append
is invoked while holding the lock of the logger. So the thread waiting for metadata in the initial send will be holding the logger lock. If the producer network thread has.a log entry that needs to be appended, it will attempt to acquire the logger lock and deadlock.This is a temporary workaround to avoid deadlocks in system tests by setting log level to WARN for
Metadata
inVerifiableLog4jAppender
. The fix has been verified using the system tests log4j_appender_test.py which started failing when the info-level log entry was introduced.Committer Checklist (excluded from commit message)