changeset 3399:c8777e7773f8 HEAD

If all auth workers have died, don't complain and fail but just create and use the new process.
author Timo Sirainen <tss@iki.fi>
date Sat, 28 May 2005 18:14:12 +0300
parents 97b996dd5942
children ddfa507bb74f
files src/auth/auth-worker-server.c
diffstat 1 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/auth-worker-server.c	Sat May 28 15:51:43 2005 +0300
+++ b/src/auth/auth-worker-server.c	Sat May 28 18:14:12 2005 +0300
@@ -247,16 +247,17 @@
 
 	conn = auth_worker_find_free();
 	if (conn == NULL) {
-		/* no connections currently. shouldn't happen unless they
-		   all just crashed.. */
-		auth_request_log_error(auth_request, "worker-server",
-				       "All auth workers have died");
-		reply = t_strdup_printf("FAIL\t%d",
-					PASSDB_RESULT_INTERNAL_FAILURE);
-		callback(auth_request, reply);
-
-		auth_worker_create();
-		return;
+		/* no connections currently. can happen if all have been
+		   idle for last 10 minutes. create a new one. */
+		conn = auth_worker_create();
+		if (conn == NULL) {
+			auth_request_log_error(auth_request, "worker-server",
+				"Couldn't create new auth worker");
+			reply = t_strdup_printf("FAIL\t%d",
+						PASSDB_RESULT_INTERNAL_FAILURE);
+			callback(auth_request, reply);
+			return;
+		}
 	}
 
 	iov[0].iov_base = t_strdup_printf("%d\t", ++conn->id_counter);