mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 14:50:59 +01:00
MINOR: fd: don't report maxfd in alert messages
The listeners and connectors may complain that process-wide or system-wide FD limits have been reached and will in this case report maxfd as the limit. This is wrong in fact since there's no reason for the whole FD space to be contiguous when the total # of FD is reached. A better approach would consist in reporting the accurate number of opened FDs, but this is pointless as what matters here is to give a hint about what might be wrong. So let's simply report the configured maxsock, which will generally explain why the process' limits were reached, which is the most common reason. This removes another dependency on maxfd.
This commit is contained in:
parent
ce036bc2da
commit
c5532acb4d
@ -570,21 +570,21 @@ void listener_accept(int fd)
|
|||||||
case ENFILE:
|
case ENFILE:
|
||||||
if (p)
|
if (p)
|
||||||
send_log(p, LOG_EMERG,
|
send_log(p, LOG_EMERG,
|
||||||
"Proxy %s reached system FD limit at %d. Please check system tunables.\n",
|
"Proxy %s reached system FD limit (maxsock=%d). Please check system tunables.\n",
|
||||||
p->id, maxfd);
|
p->id, global.maxsock);
|
||||||
goto transient_error;
|
goto transient_error;
|
||||||
case EMFILE:
|
case EMFILE:
|
||||||
if (p)
|
if (p)
|
||||||
send_log(p, LOG_EMERG,
|
send_log(p, LOG_EMERG,
|
||||||
"Proxy %s reached process FD limit at %d. Please check 'ulimit-n' and restart.\n",
|
"Proxy %s reached process FD limit (maxsock=%d). Please check 'ulimit-n' and restart.\n",
|
||||||
p->id, maxfd);
|
p->id, global.maxsock);
|
||||||
goto transient_error;
|
goto transient_error;
|
||||||
case ENOBUFS:
|
case ENOBUFS:
|
||||||
case ENOMEM:
|
case ENOMEM:
|
||||||
if (p)
|
if (p)
|
||||||
send_log(p, LOG_EMERG,
|
send_log(p, LOG_EMERG,
|
||||||
"Proxy %s reached system memory limit at %d sockets. Please check system tunables.\n",
|
"Proxy %s reached system memory limit (maxsock=%d). Please check system tunables.\n",
|
||||||
p->id, maxfd);
|
p->id, global.maxsock);
|
||||||
goto transient_error;
|
goto transient_error;
|
||||||
default:
|
default:
|
||||||
/* unexpected result, let's give up and let other tasks run */
|
/* unexpected result, let's give up and let other tasks run */
|
||||||
|
|||||||
@ -314,20 +314,20 @@ int tcp_connect_server(struct connection *conn, int data, int delack)
|
|||||||
if (errno == ENFILE) {
|
if (errno == ENFILE) {
|
||||||
conn->err_code = CO_ER_SYS_FDLIM;
|
conn->err_code = CO_ER_SYS_FDLIM;
|
||||||
send_log(be, LOG_EMERG,
|
send_log(be, LOG_EMERG,
|
||||||
"Proxy %s reached system FD limit at %d. Please check system tunables.\n",
|
"Proxy %s reached system FD limit (maxsock=%d). Please check system tunables.\n",
|
||||||
be->id, maxfd);
|
be->id, global.maxsock);
|
||||||
}
|
}
|
||||||
else if (errno == EMFILE) {
|
else if (errno == EMFILE) {
|
||||||
conn->err_code = CO_ER_PROC_FDLIM;
|
conn->err_code = CO_ER_PROC_FDLIM;
|
||||||
send_log(be, LOG_EMERG,
|
send_log(be, LOG_EMERG,
|
||||||
"Proxy %s reached process FD limit at %d. Please check 'ulimit-n' and restart.\n",
|
"Proxy %s reached process FD limit (maxsock=%d). Please check 'ulimit-n' and restart.\n",
|
||||||
be->id, maxfd);
|
be->id, global.maxsock);
|
||||||
}
|
}
|
||||||
else if (errno == ENOBUFS || errno == ENOMEM) {
|
else if (errno == ENOBUFS || errno == ENOMEM) {
|
||||||
conn->err_code = CO_ER_SYS_MEMLIM;
|
conn->err_code = CO_ER_SYS_MEMLIM;
|
||||||
send_log(be, LOG_EMERG,
|
send_log(be, LOG_EMERG,
|
||||||
"Proxy %s reached system memory limit at %d sockets. Please check system tunables.\n",
|
"Proxy %s reached system memory limit (maxsock=%d). Please check system tunables.\n",
|
||||||
be->id, maxfd);
|
be->id, global.maxsock);
|
||||||
}
|
}
|
||||||
else if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) {
|
else if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) {
|
||||||
conn->err_code = CO_ER_NOPROTO;
|
conn->err_code = CO_ER_NOPROTO;
|
||||||
|
|||||||
@ -452,20 +452,20 @@ static int uxst_connect_server(struct connection *conn, int data, int delack)
|
|||||||
if (errno == ENFILE) {
|
if (errno == ENFILE) {
|
||||||
conn->err_code = CO_ER_SYS_FDLIM;
|
conn->err_code = CO_ER_SYS_FDLIM;
|
||||||
send_log(be, LOG_EMERG,
|
send_log(be, LOG_EMERG,
|
||||||
"Proxy %s reached system FD limit at %d. Please check system tunables.\n",
|
"Proxy %s reached system FD limit (maxsock=%d). Please check system tunables.\n",
|
||||||
be->id, maxfd);
|
be->id, global.maxsock);
|
||||||
}
|
}
|
||||||
else if (errno == EMFILE) {
|
else if (errno == EMFILE) {
|
||||||
conn->err_code = CO_ER_PROC_FDLIM;
|
conn->err_code = CO_ER_PROC_FDLIM;
|
||||||
send_log(be, LOG_EMERG,
|
send_log(be, LOG_EMERG,
|
||||||
"Proxy %s reached process FD limit at %d. Please check 'ulimit-n' and restart.\n",
|
"Proxy %s reached process FD limit (maxsock=%d). Please check 'ulimit-n' and restart.\n",
|
||||||
be->id, maxfd);
|
be->id, global.maxsock);
|
||||||
}
|
}
|
||||||
else if (errno == ENOBUFS || errno == ENOMEM) {
|
else if (errno == ENOBUFS || errno == ENOMEM) {
|
||||||
conn->err_code = CO_ER_SYS_MEMLIM;
|
conn->err_code = CO_ER_SYS_MEMLIM;
|
||||||
send_log(be, LOG_EMERG,
|
send_log(be, LOG_EMERG,
|
||||||
"Proxy %s reached system memory limit at %d sockets. Please check system tunables.\n",
|
"Proxy %s reached system memory limit (maxsock=%d). Please check system tunables.\n",
|
||||||
be->id, maxfd);
|
be->id, global.maxsock);
|
||||||
}
|
}
|
||||||
else if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) {
|
else if (errno == EAFNOSUPPORT || errno == EPROTONOSUPPORT) {
|
||||||
conn->err_code = CO_ER_NOPROTO;
|
conn->err_code = CO_ER_NOPROTO;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user