Fix to release shared memory segments when Pgpool-II exits.
authorTatsuo Ishii <[email protected]>
Thu, 23 Feb 2017 07:05:11 +0000 (16:05 +0900)
committerTatsuo Ishii <[email protected]>
Thu, 23 Feb 2017 07:08:27 +0000 (16:08 +0900)
Per bug272. From the bug report.
"This cause the creation of a lot of segments if you start and stop
pgpool continuously (and in a testing fase it could be normal). Lot of
segments bring to reach the shmem OS configuration limit and than
suddenly stops (pgpool) working."

pool_shmem.c

index 6a87dfa3e4bf0668c0c08c469097887561aa83e2..56ab2d9d37c911403eeb7ec71a83b55d3a6f3181 100644 (file)
@@ -115,8 +115,10 @@ IpcMemoryDelete(int status, Datum shmId)
        if (shmctl(shmId, IPC_STAT, &shmStat) < 0
                && (errno == EINVAL || errno == EACCES))
                return;
+#ifdef NOT_USED
        else if (shmStat.shm_nattch != 0)
                return;
+#endif
 
        if (shmctl(shmId, IPC_RMID, NULL) < 0)
                pool_log("shmctl(%lu, %d, 0) failed: %s",