Browse Source

Don't extract sockaddr when we have an old fd

master
Con Kolivas 10 years ago
parent
commit
73e807a6b6
  1. 6
      src/ckpool.c
  2. 1
      src/connector.c

6
src/ckpool.c

@ -835,7 +835,7 @@ static void __shutdown_children(ckpool_t *ckp, int sig)
int i; int i;
pthread_cancel(ckp->pth_watchdog); pthread_cancel(ckp->pth_watchdog);
join_pthread(ckp->pth_watchdog); //join_pthread(ckp->pth_watchdog);
for (i = 0; i < ckp->proc_instances; i++) { for (i = 0; i < ckp->proc_instances; i++) {
pid_t pid = ckp->children[i]->pid; pid_t pid = ckp->children[i]->pid;
@ -847,7 +847,7 @@ static void __shutdown_children(ckpool_t *ckp, int sig)
static void shutdown_children(ckpool_t *ckp, int sig) static void shutdown_children(ckpool_t *ckp, int sig)
{ {
pthread_cancel(ckp->pth_watchdog); pthread_cancel(ckp->pth_watchdog);
join_pthread(ckp->pth_watchdog); //join_pthread(ckp->pth_watchdog);
__shutdown_children(ckp, sig); __shutdown_children(ckp, sig);
} }
@ -859,7 +859,7 @@ static void sighandler(int sig)
LOGWARNING("Parent process %s received signal %d, shutting down", LOGWARNING("Parent process %s received signal %d, shutting down",
ckp->name, sig); ckp->name, sig);
pthread_cancel(ckp->pth_watchdog); pthread_cancel(ckp->pth_watchdog);
join_pthread(ckp->pth_watchdog); //join_pthread(ckp->pth_watchdog);
__shutdown_children(ckp, SIGTERM); __shutdown_children(ckp, SIGTERM);
/* Wait a second, then send SIGKILL */ /* Wait a second, then send SIGKILL */

1
src/connector.c

@ -576,7 +576,6 @@ int connector(proc_instance_t *pi)
LOGWARNING("%s connector starting", ckp->name); LOGWARNING("%s connector starting", ckp->name);
if (ckp->oldconnfd > 0) { if (ckp->oldconnfd > 0) {
extract_sockaddr(ckp->serverurl, &url, &port);
sockd = ckp->oldconnfd; sockd = ckp->oldconnfd;
} else if (ckp->serverurl) { } else if (ckp->serverurl) {
if (!extract_sockaddr(ckp->serverurl, &url, &port)) { if (!extract_sockaddr(ckp->serverurl, &url, &port)) {

Loading…
Cancel
Save