Created
April 16, 2012 22:26
-
-
Save jzawodn/2402061 to your computer and use it in GitHub Desktop.
remove sphinx shutdown race condition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- searchd.cpp.orig 2012-04-16 15:23:46.000000000 -0700 | |
+++ searchd.cpp 2012-04-16 15:24:45.000000000 -0700 | |
@@ -1398,6 +1398,13 @@ | |
ARRAY_FOREACH ( i, g_dListeners ) | |
if ( g_dListeners[i].m_iSock>=0 ) | |
sphSockClose ( g_dListeners[i].m_iSock ); | |
+ | |
+ // remove pid | |
+ if ( g_bHeadDaemon && g_sPidFile ) | |
+ { | |
+ ::close ( g_iPidFD ); | |
+ ::unlink ( g_sPidFile ); | |
+ } | |
#if USE_WINDOWS | |
CloseHandle ( g_hPipe ); | |
@@ -1411,13 +1418,6 @@ | |
} | |
#endif | |
- // remove pid | |
- if ( g_bHeadDaemon && g_sPidFile ) | |
- { | |
- ::close ( g_iPidFD ); | |
- ::unlink ( g_sPidFile ); | |
- } | |
- | |
if ( g_bHeadDaemon ) | |
sphInfo ( "shutdown complete" ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment