]> andersk Git - moira.git/commitdiff
wait a minute after deadlock before trying again to update state in DB
authormar <mar>
Mon, 21 Aug 1989 21:54:17 +0000 (21:54 +0000)
committermar <mar>
Mon, 21 Aug 1989 21:54:17 +0000 (21:54 +0000)
dcm/dcm.c

index bfb5cfab103804817de197e41993b206da04df2d..1863a204ec1d0527fb752e946b68184223c5b4e8 100644 (file)
--- a/dcm/dcm.c
+++ b/dcm/dcm.c
@@ -34,6 +34,9 @@ int gqval();
 long time();
 
 
+#define DEADLOCK_WAIT  (3 * 60)        /* number of seconds to wait after
+                                          a deadlock before trying again. */
+
 /* declared global so that we can get the current time from different places. */
 struct timeval tv;
 
@@ -253,7 +256,8 @@ do_services()
                                   scream, NULL);
                if (status) {
                    com_err(whoami, status,
-                           " setting service state, trying again");
+                           " setting service state, sleeping");
+                   sleep(DEADLOCK_WAIT);
                    status = sms_query("set_server_internal_flags", 6, qargv,
                                       scream, NULL);
                    if (status)
@@ -411,7 +415,8 @@ struct service *svc;
                                   6, qargv, scream, NULL);
                if (status) {
                    com_err(whoami, status,
-                           " setting service state, trying again");
+                           " setting service state, sleeping");
+                   sleep(DEADLOCK_WAIT);
                    status = sms_query("set_server_internal_flags",
                                       6, qargv, scream, NULL);
                    if (status)
@@ -431,7 +436,8 @@ struct service *svc;
                                   9, argv,scream,NULL);
                if (status) {
                    com_err(whoami, status,
-                           " setting host state, trying again");
+                           " setting host state, sleeping");
+                   sleep(DEADLOCK_WAIT);
                    status = sms_query("set_server_host_internal",
                                       9, argv,scream,NULL);
                    if (status)
@@ -446,7 +452,8 @@ struct service *svc;
        close(lock_fd);
        status = sms_query("set_server_host_internal", 9, argv,scream,NULL);
        if (status) {
-           com_err(whoami, status, " setting host state, trying again");
+           com_err(whoami, status, " setting host state, sleeping");
+           sleep(DEADLOCK_WAIT);
            status = sms_query("set_server_host_internal", 9, argv,scream,NULL);
            if (status)
              com_err(whoami, status, " setting host state again");
This page took 0.62445 seconds and 5 git commands to generate.