Egoitz Aurrekoetxea
2015-03-05 15:59:45 UTC
God afternoon,
Iâm running some issues in a FreeBSD 10.1 RELENG machine with Perdition 2.1. Once or twice a day the parent process of POP3 or IMAP4 service dies. After doing some
investigations have seen the problem comes when at vanessa_socket_server.c file at __vanessa_socket_server_accept() when it does the accept(). It seems accept() is failing
with 53 (which continues) and later with 35 (talking about errno of course) with which exits with -1. So later is returning to __vanessa_socket_server_acceptv() and this one returns to
vanessa_socket_server_acceptv due to :
if (child < 0)
return status;
At this function (the last one) does exist :
child = __vanessa_socket_server_acceptv(&g, ufds[i].fd,
listen_socketv,
maximum_connections,
return_from, return_to, flag);
VANESSA_LOGGER_DEBUG("EGOITZ 1E");
if (child < 0) {
VANESSA_LOGGER_DEBUG(
"__vanessa_socket_server_acceptv");
goto err;
Perhaps this file be (please ignore the debugging literals) could be like this ?
--- vanessa_socket_server.c 2010-06-22 09:21:37.000000000 +0200
+++ vanessa_socket_server.c 2015-03-05 16:50:25.000000000 +0100
@@ -388,10 +388,20 @@
addrlen = sizeof(from);
*g = accept(listen_socket, (struct sockaddr *) &from, &addrlen);
if (*g < 0) {
+ char codigo[20];
+ sprintf(codigo, "%d", errno);
+ VANESSA_LOGGER_DEBUG("Falla accept con el error");
+ VANESSA_LOGGER_DEBUG("=========================");
+ VANESSA_LOGGER_DEBUG(codigo);
+ VANESSA_LOGGER_DEBUG("=========================");
+ if (errno == EAGAIN)
+ {
+ VANESSA_LOGGER_DEBUG("TENEMOS UN EAGAIN");
+ }
if(errno == EINTR || errno == ECONNABORTED) {
continue; /* Ignore EINTR and ECONNABORTED */
}
- if (errno == EAGAIN || errno == EWOULDBLOCK)
+ if (errno == EWOULDBLOCK || errno == EAGAIN)
return -1; /* Don't log EAGAIN or EWOULDBLOCK */
VANESSA_LOGGER_DEBUG_ERRNO("accept");
return(-1);
@@ -551,7 +561,10 @@
flag);
if (child < 0) {
if (errno == EAGAIN || errno == EWOULDBLOCK)
+ {
status = 0;
+ VANESSA_LOGGER_DEBUG("EGOITZ STATUS -----> 0");
+ }
else {
VANESSA_LOGGER_DEBUG("__vanessa_socket_server_accept");
status = -1;
@@ -561,6 +574,7 @@
if (!(opt & O_NONBLOCK) && child &&
fcntl(listen_socket, F_SETFL, opt) < 0) {
VANESSA_LOGGER_DEBUG_ERRNO("fcntl: F_SETFL 2");
+ VANESSA_LOGGER_DEBUG("ERROR 0000001 AAAAA");
status = -1;
}
@@ -570,6 +584,7 @@
if (!(opt & O_NONBLOCK) && (flag & VANESSA_SOCKET_NO_FORK || !child) &&
fcntl(*g, F_SETFL, opt) < 0) {
VANESSA_LOGGER_DEBUG_ERRNO("fcntl: F_SETFL 3");
+ VANESSA_LOGGER_DEBUG("ERROR 0000002 BBBB");
status = -1;
}
@@ -632,6 +647,10 @@
"__vanessa_socket_server_acceptv");
goto err;
}
+ if (!child && g < 0)
+ {
+ break;
+ }
if (flag & VANESSA_SOCKET_NO_FORK || !child) {
status = g;
goto out;
Mainly talking about :
+ if (!child && g < 0)
+ {
+ break;
+ }
That way polling again socket fds instead of exiting and stop servicing the affected protocol in each case (POP3 or IMAP4)??
Have done this last modification without having the luck of having an abnormal termination again, in order to check if this worksâŠ
Has anyone have noticed about something similar?.
Thank you so much,
Regards,
Egoitz Aurrekoetxea
Departamento de sistemas
944 209 470
Parque Tecnológico. Edificio 103
48170 Zamudio (Bizkaia)
***@sarenet.es <mailto:***@sarenet.es>
www.sarenet.es <http://www.sarenet.es/>
Antes de imprimir este correo electrónico piense si es necesario hacerlo.
Iâm running some issues in a FreeBSD 10.1 RELENG machine with Perdition 2.1. Once or twice a day the parent process of POP3 or IMAP4 service dies. After doing some
investigations have seen the problem comes when at vanessa_socket_server.c file at __vanessa_socket_server_accept() when it does the accept(). It seems accept() is failing
with 53 (which continues) and later with 35 (talking about errno of course) with which exits with -1. So later is returning to __vanessa_socket_server_acceptv() and this one returns to
vanessa_socket_server_acceptv due to :
if (child < 0)
return status;
At this function (the last one) does exist :
child = __vanessa_socket_server_acceptv(&g, ufds[i].fd,
listen_socketv,
maximum_connections,
return_from, return_to, flag);
VANESSA_LOGGER_DEBUG("EGOITZ 1E");
if (child < 0) {
VANESSA_LOGGER_DEBUG(
"__vanessa_socket_server_acceptv");
goto err;
Perhaps this file be (please ignore the debugging literals) could be like this ?
--- vanessa_socket_server.c 2010-06-22 09:21:37.000000000 +0200
+++ vanessa_socket_server.c 2015-03-05 16:50:25.000000000 +0100
@@ -388,10 +388,20 @@
addrlen = sizeof(from);
*g = accept(listen_socket, (struct sockaddr *) &from, &addrlen);
if (*g < 0) {
+ char codigo[20];
+ sprintf(codigo, "%d", errno);
+ VANESSA_LOGGER_DEBUG("Falla accept con el error");
+ VANESSA_LOGGER_DEBUG("=========================");
+ VANESSA_LOGGER_DEBUG(codigo);
+ VANESSA_LOGGER_DEBUG("=========================");
+ if (errno == EAGAIN)
+ {
+ VANESSA_LOGGER_DEBUG("TENEMOS UN EAGAIN");
+ }
if(errno == EINTR || errno == ECONNABORTED) {
continue; /* Ignore EINTR and ECONNABORTED */
}
- if (errno == EAGAIN || errno == EWOULDBLOCK)
+ if (errno == EWOULDBLOCK || errno == EAGAIN)
return -1; /* Don't log EAGAIN or EWOULDBLOCK */
VANESSA_LOGGER_DEBUG_ERRNO("accept");
return(-1);
@@ -551,7 +561,10 @@
flag);
if (child < 0) {
if (errno == EAGAIN || errno == EWOULDBLOCK)
+ {
status = 0;
+ VANESSA_LOGGER_DEBUG("EGOITZ STATUS -----> 0");
+ }
else {
VANESSA_LOGGER_DEBUG("__vanessa_socket_server_accept");
status = -1;
@@ -561,6 +574,7 @@
if (!(opt & O_NONBLOCK) && child &&
fcntl(listen_socket, F_SETFL, opt) < 0) {
VANESSA_LOGGER_DEBUG_ERRNO("fcntl: F_SETFL 2");
+ VANESSA_LOGGER_DEBUG("ERROR 0000001 AAAAA");
status = -1;
}
@@ -570,6 +584,7 @@
if (!(opt & O_NONBLOCK) && (flag & VANESSA_SOCKET_NO_FORK || !child) &&
fcntl(*g, F_SETFL, opt) < 0) {
VANESSA_LOGGER_DEBUG_ERRNO("fcntl: F_SETFL 3");
+ VANESSA_LOGGER_DEBUG("ERROR 0000002 BBBB");
status = -1;
}
@@ -632,6 +647,10 @@
"__vanessa_socket_server_acceptv");
goto err;
}
+ if (!child && g < 0)
+ {
+ break;
+ }
if (flag & VANESSA_SOCKET_NO_FORK || !child) {
status = g;
goto out;
Mainly talking about :
+ if (!child && g < 0)
+ {
+ break;
+ }
That way polling again socket fds instead of exiting and stop servicing the affected protocol in each case (POP3 or IMAP4)??
Have done this last modification without having the luck of having an abnormal termination again, in order to check if this worksâŠ
Has anyone have noticed about something similar?.
Thank you so much,
Regards,
Egoitz Aurrekoetxea
Departamento de sistemas
944 209 470
Parque Tecnológico. Edificio 103
48170 Zamudio (Bizkaia)
***@sarenet.es <mailto:***@sarenet.es>
www.sarenet.es <http://www.sarenet.es/>
Antes de imprimir este correo electrónico piense si es necesario hacerlo.