Permalink
Browse files

Fix #426 crash because race of 'success' flag on connection

  • Loading branch information...
klirichek committed Sep 6, 2018
1 parent 5a09c32 commit 1d17669cb7ec54ac80b392e101f37a688eb98080
Showing with 3 additions and 3 deletions.
  1. +2 −2 src/searchdha.cpp
  2. +1 −1 src/searchdha.h
@@ -2192,7 +2192,7 @@ void AgentConn_t::StartRemoteLoopTry ()
m_tOutput.Reset ();
InitReplyBuf ();
m_bConnectHandshake = true;
m_bSuccess = false;
m_bSuccess = 0;
m_iStartQuery = 0;
m_pPollerTask = nullptr;
@@ -2507,12 +2507,12 @@ bool AgentConn_t::CommitResult ()
return BadResult ();
Finish();
m_bSuccess = true;
if ( !bWarnings )
bWarnings = m_dResults.FindFirst ( [] ( const CSphQueryResult &dRes ) { return !dRes.m_sWarning.IsEmpty(); } );
agent_stats_inc ( *this, bWarnings ? eNetworkCritical : eNetworkNonCritical );
m_bSuccess = 1;
return true;
}
@@ -481,7 +481,7 @@ struct AgentConn_t : public ISphRefcountedMT
CSphRefcountedPtr<IReporter_t> m_pReporter { nullptr }; ///< used to report back when we're finished
LPKEY m_pPollerTask = nullptr; ///< internal for poller. fixme! privatize?
bool m_bSuccess = false; ///< agent got processed, no need to retry
CSphAtomic m_bSuccess; ///< agent got processed, no need to retry
public:
AgentConn_t () = default;

0 comments on commit 1d17669

Please sign in to comment.