diff options
| author | Pavan Deolasee | 2014-12-08 06:41:57 +0000 |
|---|---|---|
| committer | Pavan Deolasee | 2015-04-15 05:46:41 +0000 |
| commit | f3396d6eaae5b30281790f5075d4ce0a63f32495 (patch) | |
| tree | e6804bfb60d8aae62b7a3792172770f57e882f81 | |
| parent | 9a7b07ac8bb9fb3522a1a054db1233e0724df675 (diff) | |
Ignore SIGPIPE in GTM and GTM Proxy
SIGPIPE causes these processes to exit prematurely if the remote side
goes away without properly closing connections. For now, just ignore the signal
| -rw-r--r-- | src/gtm/main/main.c | 1 | ||||
| -rw-r--r-- | src/gtm/proxy/proxy_main.c | 12 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/gtm/main/main.c b/src/gtm/main/main.c index 240738d3b2..371ebcd7d5 100644 --- a/src/gtm/main/main.c +++ b/src/gtm/main/main.c @@ -747,6 +747,7 @@ main(int argc, char *argv[]) pqsignal(SIGTERM, GTM_SigleHandler); pqsignal(SIGINT, GTM_SigleHandler); pqsignal(SIGUSR1, GTM_SigleHandler); + pqsignal(SIGPIPE, SIG_IGN); pqinitmask(); diff --git a/src/gtm/proxy/proxy_main.c b/src/gtm/proxy/proxy_main.c index d76074fbf5..a9f141a5a1 100644 --- a/src/gtm/proxy/proxy_main.c +++ b/src/gtm/proxy/proxy_main.c @@ -865,6 +865,7 @@ main(int argc, char *argv[]) pqsignal(SIGINT, GTMProxy_SigleHandler); pqsignal(SIGUSR1, GTMProxy_SigleHandler); pqsignal(SIGUSR2, GTMProxy_SigleHandler); + pqsignal(SIGPIPE, SIG_IGN); pqinitmask(); @@ -3241,7 +3242,16 @@ UnregisterProxy(void) return; failed: - return elog(ERROR, "can not Unregister Proxy on GTM"); + /* + * We don't deliberately write an ERROR here to ensure that proxy shutdown + * proceeds to the end. Without that we have a danger of leaving behind a + * stale PID file, thus causing gtm_ctl stop to wait forever for the proxy + * to shutdown + * + * XXX This can happen when GTM restarts, clearing existing registration + * information. See if this needs to fixed + */ + return elog(LOG, "can not Unregister Proxy on GTM"); } /* |
