Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix #426 crash because race of 'success' flag on connection
- Loading branch information
Showing
with
3 additions
and
3 deletions.
-
+2
−2
src/searchdha.cpp
-
+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; |
|
|