Browse Source

ckdb - change shutdown to terminate

master
kanoi 10 years ago
parent
commit
c15407e68a
  1. 14
      src/ckdb.c
  2. 4
      src/ckdb.h
  3. 8
      src/ckdb_cmd.c

14
src/ckdb.c

@ -2653,8 +2653,8 @@ static void *socketer(__maybe_unused void *arg)
snprintf(reply, sizeof(reply), "%s.%ld.?.", id, now.tv_sec); snprintf(reply, sizeof(reply), "%s.%ld.?.", id, now.tv_sec);
send_unix_msg(sockd, reply); send_unix_msg(sockd, reply);
break; break;
case CMD_SHUTDOWN: case CMD_TERMINATE:
LOGWARNING("Listener received shutdown message, terminating ckdb"); LOGWARNING("Listener received terminate message, terminating ckdb");
snprintf(reply, sizeof(reply), "%s.%ld.ok.exiting", id, now.tv_sec); snprintf(reply, sizeof(reply), "%s.%ld.ok.exiting", id, now.tv_sec);
send_unix_msg(sockd, reply); send_unix_msg(sockd, reply);
everyone_die = true; everyone_die = true;
@ -2990,7 +2990,7 @@ static bool reload_line(PGconn *conn, char *filename, uint64_t count, char *buf)
case CMD_REPLY: case CMD_REPLY:
break; break;
// Shouldn't be there // Shouldn't be there
case CMD_SHUTDOWN: case CMD_TERMINATE:
case CMD_PING: case CMD_PING:
case CMD_VERSION: case CMD_VERSION:
case CMD_LOGLEVEL: case CMD_LOGLEVEL:
@ -3198,7 +3198,7 @@ static bool reload_from(tv_t *start)
LOGWARNING("%s(): %sread %"PRIu64" line%s from %s", LOGWARNING("%s(): %sread %"PRIu64" line%s from %s",
__func__, __func__,
everyone_die ? "Shutdown, aborting - " : "", everyone_die ? "Terminate, aborting - " : "",
count, count == 1 ? "" : "s", count, count == 1 ? "" : "s",
filename); filename);
total += count; total += count;
@ -4284,7 +4284,7 @@ int main(int argc, char **argv)
sigaction(SIGTERM, &handler, NULL); sigaction(SIGTERM, &handler, NULL);
sigaction(SIGINT, &handler, NULL); sigaction(SIGINT, &handler, NULL);
/* Shutdown from here if the listener is sent a shutdown message */ /* Terminate from here if the listener is sent a terminate message */
join_pthread(ckp.pth_listener); join_pthread(ckp.pth_listener);
} }
@ -4299,9 +4299,9 @@ int main(int argc, char **argv)
curr = time(NULL); curr = time(NULL);
if (curr - start > 4) { if (curr - start > 4) {
if (curr - trigger > 4) { if (curr - trigger > 4) {
msg = "Shutdown initial delay"; msg = "Terminate initial delay";
} else if (curr - trigger > 2) { } else if (curr - trigger > 2) {
msg = "Shutdown delay"; msg = "Terminate delay";
} }
} }
if (msg) { if (msg) {

4
src/ckdb.h

@ -55,7 +55,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.0" #define DB_VERSION "1.0.0"
#define CKDB_VERSION DB_VERSION"-1.051" #define CKDB_VERSION DB_VERSION"-1.052"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__
@ -343,7 +343,7 @@ extern char *id_default;
enum cmd_values { enum cmd_values {
CMD_UNSET, CMD_UNSET,
CMD_REPLY, // Means something was wrong - send back reply CMD_REPLY, // Means something was wrong - send back reply
CMD_SHUTDOWN, CMD_TERMINATE,
CMD_PING, CMD_PING,
CMD_VERSION, CMD_VERSION,
CMD_LOGLEVEL, CMD_LOGLEVEL,

8
src/ckdb_cmd.c

@ -2227,9 +2227,9 @@ seconf:
return strdup("failed.DATA"); return strdup("failed.DATA");
} else { } else {
/* Don't slow down the reload - do them later /* Don't slow down the reload - do them later
* N.B. this means if you abort/shutdown the reload, * N.B. this means if you abort/terminate the reload,
* next restart will again go back to the oldest * next restart will again go back to the oldest
* unaged sharesummary due to a pool shutdown */ * unaged sharesummary due to a pool terminate */
if (!reloading) { if (!reloading) {
// Aging is a queued item thus the reply is ignored // Aging is a queued item thus the reply is ignored
auto_age_older(conn, workinfoid, auto_age_older(conn, workinfoid,
@ -5653,7 +5653,7 @@ dame:
* ping * ping
* .STAMP.ok.pong * .STAMP.ok.pong
* *
* shutdown * terminate
* .STAMP.ok.exiting * .STAMP.ok.exiting
* *
* With an ID * With an ID
@ -5683,7 +5683,7 @@ dame:
// cmd_val cmd_str noid createdate func access // cmd_val cmd_str noid createdate func access
struct CMDS ckdb_cmds[] = { struct CMDS ckdb_cmds[] = {
{ CMD_SHUTDOWN, "shutdown", true, false, NULL, ACCESS_SYSTEM }, { CMD_TERMINATE, "terminate", true, false, NULL, ACCESS_SYSTEM },
{ CMD_PING, "ping", true, false, NULL, ACCESS_SYSTEM ACCESS_POOL ACCESS_WEB }, { CMD_PING, "ping", true, false, NULL, ACCESS_SYSTEM ACCESS_POOL ACCESS_WEB },
{ CMD_VERSION, "version", true, false, NULL, ACCESS_SYSTEM ACCESS_POOL ACCESS_WEB }, { CMD_VERSION, "version", true, false, NULL, ACCESS_SYSTEM ACCESS_POOL ACCESS_WEB },
{ CMD_LOGLEVEL, "loglevel", true, false, NULL, ACCESS_SYSTEM }, { CMD_LOGLEVEL, "loglevel", true, false, NULL, ACCESS_SYSTEM },

Loading…
Cancel
Save