-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-32822 Fix MP protocol error logged indefinitely in loop #19207
HPCC-32822 Fix MP protocol error logged indefinitely in loop #19207
Conversation
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-32822 Jirabot Action Result: |
if (periodicTimer.hasElapsed()) | ||
{ | ||
StringBuffer packetHdrBytes("Packet Header bytes: "); | ||
hexdump2string((byte const *)&hdr, sizeof(hdr), packetHdrBytes); |
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.
Should this be std::min(packetHdrBytes, sizeRead)?
Also, should the number of bytes be logged in the message?
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.
it is guaranteed to have read exactly sizeof(hdr) at this point, if it was less remaining would be >0 and it wouldn't reach here.
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.
Also, should the number of bytes be logged in the message?
could make hexdump2string prefix message with # bytes..
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.
have changed hexdump2string to include # bytes
in testing, there was another (likely the main) issue that causes repeated tracing of this issue. After the exception, the socket was left opened. |
cea0719
to
285f454
Compare
The detection of a MP packet with an invalid header threw an exception that was logged, but did not close the socket. When the client closed the socket, the MP server was notified but because it had nothing left to read of the [bad] header, it saw the invalid protocol error again and rethrew the same error. The epoll handler loop continuously notified the handler of the close event (because it did nothing with it), and the protocol error was continuosly output. The socket should be close on this and any other exception. In case these events are too frequent, add a timer to log the protocol errors less frequently, and log the header bytes received to help diagnose what the source of these 'rogue' connections are. Signed-off-by: Jake Smith <[email protected]>
285f454
to
81b3e2e
Compare
Jirabot Action Result: |
The detection of a MP packet with an invalid header threw an exception that was logged, but did not close the socket. When the client closed the socket, the MP server was notified but because it had nothing left to read of the [bad] header, it saw the invalid protocol error again and rethrew the same error. The epoll handler loop continuously notified the handler of the close event (because it did nothing with it), and the protocol error was continuously output. The socket should be close on this and any other exception. In case these events are too frequent, add a timer to log the protocol errors less frequently, and log the header bytes received to help diagnose what the source of these 'rogue' connections are.
Signed-off-by: Jake Smith [email protected]
Type of change:
Checklist:
Smoketest:
Testing: