dynomite
dynomite copied to clipboard
Ignores NULL returned by msg_get_error to avoid segfault crash
Hi,
This pull request fixes #592.
Note that msg_get_error() may return a NULL pointer when :
- Client requests are dropped under heavy traffic (call stack : req_forward_error => msg_get_error => _msg_get) :
static struct msg *_msg_get(struct conn *conn, bool request,
const char *const caller) {
struct msg *msg;
// .........
// protect our server in the slow network and high traffics.
// we drop client requests but still honor our peer requests
if (alloc_msg_count >= alloc_msgs_max) {
log_debug(LOG_WARN, "allocated #msgs %lu hit max allowable limit",
alloc_msg_count);
return NULL;
}
// .........
- Response message cannot be allocated.
Consequently, there is really no other solution than to ignore the NULL pointer and not forward the error.