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)
egoitz(a)sarenet.es <mailto:egoitz@sarenet.es>
www.sarenet.es <http://www.sarenet.es/>
Antes de imprimir este correo electrónico piense si es necesario hacerlo.
is this something that people would use? i have made a local patch that
lets me do some sql wildcard matching if there isn't an exact match in
the db. this allows me to have a front end server for multiple domains
and unless something needs special per-user handling, i can just match
on the domain and route on that. it even allows for multiple wildcard
matches and chooses the longest pattern as the best one.
for example:
%(a)foo.com server1
%(a)bar.com server2
% server3
user a(a)foo.com goes to server1, b(a)bar.com to server2, and c(a)baz.com to
server3.
if this is of interest i can send the patch. or if i've just missed an
obvious way to handle this, let me know that :-).