@@ -397,6 +397,7 @@ static CSphVector<SphThread_t> g_dTickPoolThread;
397
397
/// flush parameters of rt indexes
398
398
static SphThread_t g_tRtFlushThread;
399
399
static SphThread_t g_tBinlogFlushThread;
400
+ static BinlogFlushInfo_t g_tBinlogAutoflush;
400
401
401
402
// optimize thread
402
403
static SphThread_t g_tOptimizeThread;
@@ -1497,7 +1498,8 @@ void Shutdown ()
1497
1498
1498
1499
// tell flush-rt thread to shutdown, and wait until it does
1499
1500
sphThreadJoin ( &g_tRtFlushThread );
1500
- sphThreadJoin ( &g_tBinlogFlushThread );
1501
+ if ( g_tBinlogAutoflush.m_fnWork )
1502
+ sphThreadJoin ( &g_tBinlogFlushThread );
1501
1503
1502
1504
// tell rotation thread to shutdown, and wait until it does
1503
1505
if ( g_bSeamlessRotate )
@@ -9543,8 +9545,8 @@ struct SqlParser_c : ISphNoncopyable
9543
9545
#ifdef CMAKE_GENERATED_LEXER
9544
9546
9545
9547
#ifdef __GNUC__
9546
- #pragma GCC diagnostic push
9547
- #pragma GCC diagnostic ignored "-Wsign-compare"
9548
+ #pragma GCC diagnostic push
9549
+ #pragma GCC diagnostic ignored "-Wsign-compare"
9548
9550
#endif
9549
9551
9550
9552
#include "flexsphinxql.c"
@@ -18275,7 +18277,6 @@ static void RtFlushThreadFunc ( void * )
18275
18277
}
18276
18278
}
18277
18279
18278
- static BinlogFlushInfo_t g_tBinlogAutoflush;
18279
18280
static void RtBinlogAutoflushThreadFunc ( void * )
18280
18281
{
18281
18282
assert ( g_tBinlogAutoflush.m_pLog && g_tBinlogAutoflush.m_fnWork );
@@ -23947,7 +23948,10 @@ int WINAPI ServiceMain ( int argc, char **argv )
23947
23948
::unlink ( sNewState.cstr() );
23948
23949
23949
23950
if ( !bCanWrite )
23951
+ {
23950
23952
sphWarning ( "sphinxql_state flush disabled: %s", sError.cstr() );
23953
+ g_sSphinxqlState = ""; // need to disable thread join on shutdown
23954
+ }
23951
23955
else if ( !sphThreadCreate ( &g_tSphinxqlStateFlushThread, SphinxqlStateThreadFunc, NULL ) )
23952
23956
sphDie ( "failed to create sphinxql_state writer thread" );
23953
23957
}
0 commit comments