* Be more aggressive about shutting down when told to. Getting the
authorArt Cancro <ajc@citadel.org>
Wed, 16 Feb 2005 17:37:17 +0000 (17:37 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 16 Feb 2005 17:37:17 +0000 (17:37 +0000)
  databases closed is the highest priority.

citadel/ChangeLog
citadel/database_sleepycat.c
citadel/housekeeping.c
citadel/sysdep.c

index 80515f3c06859b433886b8b9dd26cedfe3284938..76fa1548156b281ae8f684d06049a80372c3b314 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 640.8  2005/02/16 17:37:16  ajc
+ * Be more aggressive about shutting down when told to.  Getting the
+   databases closed is the highest priority.
+
  Revision 640.7  2005/02/16 04:08:42  ajc
  * newinstall.sh: put the checksum files server-side to avoid
    unnecessary downloads
@@ -6400,3 +6404,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 9b1b740f33ad905d52f95a7d3518a97daa8005d6..193a327b02fdd99459b65236bab78510c662b002 100644 (file)
@@ -415,16 +415,18 @@ void close_databases(void)
        cdb_free_tsd();
 
        if ((ret = dbenv->txn_checkpoint(dbenv, 0, 0, 0))) {
-               lprintf(CTDL_EMERG, "cdb_*: txn_checkpoint: %s\n", db_strerror(ret));
-               abort();
+               lprintf(CTDL_EMERG,
+                       "cdb_*: txn_checkpoint: %s\n",
+                       db_strerror(ret));
        }
 
        for (a = 0; a < MAXCDB; ++a) {
                lprintf(CTDL_INFO, "cdb_*: Closing database %d\n", a);
                ret = dbp[a]->close(dbp[a], 0);
                if (ret) {
-                       lprintf(CTDL_EMERG, "cdb_*: db_close: %s\n", db_strerror(ret));
-                       abort();
+                       lprintf(CTDL_EMERG,
+                               "cdb_*: db_close: %s\n",
+                               db_strerror(ret));
                }
                
        }
@@ -432,8 +434,9 @@ void close_databases(void)
         /* Close the handle. */
         ret = dbenv->close(dbenv, 0);
        if (ret) {
-                lprintf(CTDL_EMERG, "cdb_*: DBENV->close: %s\n", db_strerror(ret));
-               abort();
+                lprintf(CTDL_EMERG,
+                       "cdb_*: DBENV->close: %s\n",
+                       db_strerror(ret));
         }
 }
 
index 788fd913bae76f7b6fcb3d71d53fe136cfefe529..1b8deeb9a264359939af70fa54815864fb6e81e6 100644 (file)
@@ -82,6 +82,7 @@ void check_sched_shutdown(void) {
        if ((ScheduledShutdown == 1) && (ContextList == NULL)) {
                lprintf(CTDL_NOTICE, "Scheduled shutdown initiating.\n");
                time_to_die = 1;
+               master_cleanup();
        }
 }
 
index 353ab0ed8ad7ffe2020468ced248a3592f67c1b1..e100ec67cdb4ff5ee30beec665e1a85a74400bd6 100644 (file)
@@ -171,7 +171,9 @@ void lprintf(enum LogLevel loglevel, const char *format, ...) {
 volatile int time_to_die = 0;
 
 static RETSIGTYPE signal_cleanup(int signum) {
+       lprintf(CTDL_DEBUG, "Signal %d received.\n", signum);
        time_to_die = 1;
+       master_cleanup();       /* will this work? */
 }
 
 
@@ -525,7 +527,9 @@ void client_write(char *buf, int nbytes)
        int bytes_written = 0;
        int retval;
        int sock;
+#ifndef HAVE_TCP_BUFFERING
        int old_buffer_len = 0;
+#endif
 
        if (CC->redirect_fp != NULL) {
                fwrite(buf, (size_t)nbytes, (size_t)1, CC->redirect_fp);