]> granicus.if.org Git - apache/commitdiff
Make the Unix MPMs not clean the scoreboard on a graceful restart. This
authorRyan Bloom <rbb@apache.org>
Mon, 31 Jul 2000 01:39:54 +0000 (01:39 +0000)
committerRyan Bloom <rbb@apache.org>
Mon, 31 Jul 2000 01:39:54 +0000 (01:39 +0000)
compiles, but it hasn't actually been tested yet.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85957 13f79535-47bb-0310-9956-ffa450edef68

12 files changed:
server/mpm/dexter/dexter.c
server/mpm/dexter/scoreboard.c
server/mpm/dexter/scoreboard.h
server/mpm/experimental/perchild/mpm.h
server/mpm/experimental/perchild/perchild.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm/mpmt_pthread/scoreboard.c
server/mpm/mpmt_pthread/scoreboard.h
server/mpm/perchild/mpm.h
server/mpm/perchild/perchild.c
server/mpm/perchild/scoreboard.c
server/mpm/perchild/scoreboard.h

index 1cf9f5fa64bb8a2f02a82ffbbbfd6d6d38117d20..7de8d0108d877d3ab46910fb39982e9054a16fa6 100644 (file)
@@ -249,7 +249,7 @@ void ap_start_shutdown(void)
 }
 
 /* do a graceful restart if graceful == 1 */
-void ap_start_restart(int graceful)
+static void ap_start_restart(int graceful)
 {
 
     if (restart_pending == 1) {
@@ -258,6 +258,9 @@ void ap_start_restart(int graceful)
     }
     restart_pending = 1;
     is_graceful = graceful;
+    if (is_graceful) {
+        ap_kill_cleanup(pconf, NULL, ap_cleanup_shared_mem);
+    }
 }
 
 static void sig_term(int sig)
index ba85fd3c4867ecb84f0909a04b54e06bfc260e97..02e5dd8ed669f2e9ee78615f9dac70278772b9a4 100644 (file)
@@ -88,7 +88,7 @@ static scoreboard *ap_scoreboard_image = NULL;
 
 static ap_shmem_t *scoreboard_shm = NULL;
 
-static ap_status_t cleanup_shared_mem(void *d)
+ap_status_t ap_cleanup_shared_mem(void *d)
 {
     ap_shm_free(scoreboard_shm, ap_scoreboard_image);
     ap_scoreboard_image = NULL;
@@ -116,7 +116,7 @@ static void setup_shared_mem(ap_pool_t *p)
         ap_shm_destroy(scoreboard_shm);
         exit(APEXIT_INIT);
     }
-    ap_register_cleanup(p, NULL, cleanup_shared_mem, ap_null_cleanup);
+    ap_register_cleanup(p, NULL, ap_cleanup_shared_mem, ap_null_cleanup);
 }
 
 void reinit_scoreboard(ap_pool_t *p)
index 5fc598fb3dc6246d27455339946557b752add998..73a54f1b6c0d4da1a64e5b7eb3b6aac7427af3f8 100644 (file)
@@ -100,6 +100,8 @@ typedef struct {
 
 API_VAR_EXPORT extern const char *ap_scoreboard_fname;
 
+ap_status_t ap_cleanup_shared_mem(void *d);
+
 #ifdef __cplusplus
 }
 #endif
index c5c74e74b7bc59f765702771081748163f90f208..062f83f68e643baf066e60e6af5645129117f6f0 100644 (file)
@@ -66,7 +66,7 @@
 #define PERCHILD_MPM
 
 #define MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
-#define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image())
+#define MPM_SYNC_CHILD_TABLE()
 #define MPM_CHILD_PID(i) (ap_child_table[i].pid)
 #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
 
index e68290d1a0ea8543f27695fae5ea308b836ec25c..bc57ba7a56db38b012813af25304dd52c1515c2a 100644 (file)
@@ -282,7 +282,7 @@ void ap_start_shutdown(void)
 }
 
 /* do a graceful restart if graceful == 1 */
-void ap_start_restart(int graceful)
+static void ap_start_restart(int graceful)
 {
 
     if (restart_pending == 1) {
@@ -291,6 +291,9 @@ void ap_start_restart(int graceful)
     }
     restart_pending = 1;
     is_graceful = graceful;
+    if (is_graceful) {
+        ap_kill_cleanup(pconf, NULL, ap_cleanup_shared_mem);
+    }
 }
 
 static void sig_term(int sig)
index 11e81420f93a0413704e5b6c6ff1f15f544c8e3a..7142bc7b5467afee285f99dfaa414403b6d975e5 100644 (file)
@@ -246,7 +246,7 @@ void ap_start_shutdown(void)
 }
 
 /* do a graceful restart if graceful == 1 */
-void ap_start_restart(int graceful)
+static void ap_start_restart(int graceful)
 {
 
     if (restart_pending == 1) {
@@ -255,6 +255,9 @@ void ap_start_restart(int graceful)
     }
     restart_pending = 1;
     is_graceful = graceful;
+    if (is_graceful) {
+        ap_kill_cleanup(pconf, NULL, ap_cleanup_shared_mem);
+    }
 }
 
 static void sig_term(int sig)
index 0775f24b9bd29f95dcfa89d08ec98cc73d093498..456dff247ac573623c8cdc8f92c204b503069cd9 100644 (file)
@@ -90,7 +90,7 @@ static int maintain_connection_status = 1;
 
 static ap_shmem_t *scoreboard_shm = NULL;
 
-static ap_status_t cleanup_shared_mem(void *d)
+ap_status_t ap_cleanup_shared_mem(void *d)
 {
     ap_shm_free(scoreboard_shm, ap_scoreboard_image);
     ap_scoreboard_image = NULL;
@@ -120,7 +120,7 @@ static void setup_shared_mem(ap_pool_t *p)
         ap_shm_destroy(scoreboard_shm);
         exit(APEXIT_INIT);
     }
-    ap_register_cleanup(p, NULL, cleanup_shared_mem, ap_null_cleanup);
+    ap_register_cleanup(p, NULL, ap_cleanup_shared_mem, ap_null_cleanup);
     ap_scoreboard_image->global.running_generation = 0;
 }
 
index 6c910c4af330ec18a7f7adc9765e65aa93dd6b49..21e37e34dd8d3ca1eeaa2b4f841272f33cff8397 100644 (file)
@@ -211,7 +211,7 @@ typedef struct {
 
 API_EXPORT(int) ap_exists_scoreboard_image(void);
 void reinit_scoreboard(ap_pool_t *p);
-void cleanup_scoreboard(void);
+ap_status_t ap_cleanup_shared_mem(void *d);
 API_EXPORT(void) ap_sync_scoreboard_image(void);
 void ap_mpmt_pthread_force_reset_connection_status(long conn_id);
 
index c5c74e74b7bc59f765702771081748163f90f208..062f83f68e643baf066e60e6af5645129117f6f0 100644 (file)
@@ -66,7 +66,7 @@
 #define PERCHILD_MPM
 
 #define MPM_NEEDS_RECLAIM_CHILD_PROCESSES 1
-#define MPM_SYNC_CHILD_TABLE() (ap_sync_scoreboard_image())
+#define MPM_SYNC_CHILD_TABLE()
 #define MPM_CHILD_PID(i) (ap_child_table[i].pid)
 #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
 
index e68290d1a0ea8543f27695fae5ea308b836ec25c..bc57ba7a56db38b012813af25304dd52c1515c2a 100644 (file)
@@ -282,7 +282,7 @@ void ap_start_shutdown(void)
 }
 
 /* do a graceful restart if graceful == 1 */
-void ap_start_restart(int graceful)
+static void ap_start_restart(int graceful)
 {
 
     if (restart_pending == 1) {
@@ -291,6 +291,9 @@ void ap_start_restart(int graceful)
     }
     restart_pending = 1;
     is_graceful = graceful;
+    if (is_graceful) {
+        ap_kill_cleanup(pconf, NULL, ap_cleanup_shared_mem);
+    }
 }
 
 static void sig_term(int sig)
index a5d92c11d31384ff9aadc7dc32a04e7906d7c2b5..b44d29e2607a29cde73a17ae99ccbbef44cdb59f 100644 (file)
@@ -88,7 +88,7 @@ static scoreboard *ap_scoreboard_image = NULL;
 
 static ap_shmem_t *scoreboard_shm = NULL;
 
-static ap_status_t cleanup_shared_mem(void *d)
+ap_status_t ap_cleanup_shared_mem(void *d)
 {
     ap_shm_free(scoreboard_shm, ap_scoreboard_image);
     ap_scoreboard_image = NULL;
@@ -116,7 +116,7 @@ static void setup_shared_mem(ap_pool_t *p)
         ap_shm_destroy(scoreboard_shm);
         exit(APEXIT_INIT);
     }
-    ap_register_cleanup(p, NULL, cleanup_shared_mem, ap_null_cleanup);
+    ap_register_cleanup(p, NULL, ap_cleanup_shared_mem, ap_null_cleanup);
 }
 
 void reinit_scoreboard(ap_pool_t *p)
index bcecfd6bcc989aa95daac23bf7f0e0e464619526..9e15e6a5cc7c98cd718194a59c420f4dc3b411c0 100644 (file)
@@ -99,6 +99,7 @@ typedef struct {
 #define SCOREBOARD_SIZE                sizeof(scoreboard)
 
 API_VAR_EXPORT extern const char *ap_scoreboard_fname;
+ap_status_t ap_cleanup_shared_mem(void *d);
 
 #ifdef __cplusplus
 }