-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
HID: Avoid repeated error messages from hid_write()/hid_read() #13692
Conversation
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! Thanks
Do we think this is a sufficient mitigation for the log file size till we have a proper limiter in place?
<< mixxx::convertWCStringToQString( | ||
hid_error(pHidDevice), | ||
kMaxHidErrorMessageSize); | ||
m_hidWriteErrorLogged = true; // Don't log the same error again |
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.
This will not work as the comment describes. To ensure that only identical errors are inhibited, you need to compare the error message string.
src/controllers/hid/hidiothread.cpp
Outdated
<< mixxx::convertWCStringToQString( | ||
hid_error(m_pHidDevice), | ||
kMaxHidErrorMessageSize); | ||
m_hidReadErrorLogged = true; // Don't log the same error again |
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.
Same here
I have adjusted the error message. We want also stop log spam in the unlikely case that there are altering different error messages, because this would still fill the log file. |
I consider this a permanent solution, because we also want to avoid the performance impact, until the 100 MB log limit is from #13684 is reached. |
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.
hid_write is also used here:
mixxx/src/controllers/hid/hidioglobaloutputreportfifo.cpp
Lines 68 to 76 in d6eeb45
int result = hid_write(pHidDevice, | |
reinterpret_cast<const unsigned char*>(reportToSend.constData()), | |
reportToSend.size()); | |
if (result == -1) { | |
qCWarning(logOutput) << "Unable to send data to" << deviceInfo.formatName() << ":" | |
<< mixxx::convertWCStringToQString( | |
hid_error(pHidDevice), | |
kMaxHidErrorMessageSize); | |
} |
src/controllers/hid/hidiothread.cpp
Outdated
qCWarning(m_logOutput) << "Unable to read buffered HID InputReports from" | ||
<< m_deviceInfo.formatName() << ":" | ||
<< mixxx::convertWCStringToQString( | ||
hid_error(m_pHidDevice), | ||
kMaxHidErrorMessageSize); |
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.
qCWarning(m_logOutput) << "Unable to read buffered HID InputReports from" | |
<< m_deviceInfo.formatName() << ":" | |
<< mixxx::convertWCStringToQString( | |
hid_error(m_pHidDevice), | |
kMaxHidErrorMessageSize); | |
qCWarning(m_logOutput) << "Unable to read buffered HID InputReports from" | |
<< m_deviceInfo.formatName() << ":" | |
<< mixxx::convertWCStringToQString( | |
hid_error(m_pHidDevice), | |
kMaxHidErrorMessageSize) | |
<< "Note that, this message is only logged once and may not appear again until all hid_read errors have disappeared."; |
…ReportDataset() when hid_write() fails.
… once. Co-authored-by: JoergAtGithub <[email protected]>
Done |
Works as expected. Thank you! |
This is fixed the huge log file issue with #13660 for log spam in any disconnect case, without fixing the root cause in that particular case.