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
Fix errors in ossec-remoted when it is stressed #3602
Conversation
When a message cannot be delivered completely, send() does not set errno. That produces a random error description.
This happens when an agent disconnects suddenly.
Documentation: wazuh/wazuh-documentation#1316 |
Valgrind report
|
src/remoted/netcounter.c
Outdated
size_t counter = connections.list[fd]; | ||
w_mutex_unlock(&lock); | ||
return counter; | ||
} |
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.
Missing ending newline.
src/remoted/state.c
Outdated
w_mutex_lock(&state_mutex); | ||
remoted_state.dequeued_after_close++; | ||
w_mutex_unlock(&state_mutex); | ||
} |
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.
Missing ending newline.
8d94508
to
e0f33d5
Compare
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!
TestingTested in a AWS instance Events per second: 17259.6 ERRORS: WARNINGS:
State file
State file + 5 seconds
|
Description
This PR solves the issues described in the issue #3574.
Error 1218: Connection reset by peer
The
ECONNRESET
value is now managed: f596b65Error 1218: No such file or directory
The
errno
variable is set to 0 before thesend()
call: 7d7913cErrors caused by invalid file descriptors
The message counter described in the issue was implemented. Also the function
inet_ntoa()
was replaced byinet_ntop()
since it is not thread safe:http://man7.org/linux/man-pages/man3/inet_ntop.3.html
Tests