----------------------------------------------------------------------------- Retry a stage up to the specified maximum -----------------------------------------------------------------------------
| 785 | // Retry a stage up to the specified maximum |
| 786 | //----------------------------------------------------------------------------- |
| 787 | void Node::QueryStageRetry |
| 788 | ( |
| 789 | QueryStage const _stage, |
| 790 | uint8 const _maxAttempts // = 0 |
| 791 | ) |
| 792 | { |
| 793 | Log::Write( LogLevel_Info, m_nodeId, "QueryStageRetry stage %s requested stage %s max %d retries %d pending %d", c_queryStageNames[_stage], c_queryStageNames[m_queryStage], _maxAttempts, m_queryRetries, m_queryPending); |
| 794 | |
| 795 | // Check that we are actually on the specified stage |
| 796 | if( _stage != m_queryStage ) |
| 797 | { |
| 798 | return; |
| 799 | } |
| 800 | |
| 801 | m_queryPending = false; |
| 802 | if( _maxAttempts && ( ++m_queryRetries >= _maxAttempts ) ) |
| 803 | { |
| 804 | m_queryRetries = 0; |
| 805 | // We've retried too many times. Move to the next stage but only if |
| 806 | // we aren't in any of the probe stages. |
| 807 | if( m_queryStage != QueryStage_Probe && m_queryStage != QueryStage_CacheLoad ) |
| 808 | { |
| 809 | m_queryStage = (Node::QueryStage)( (uint32)(m_queryStage + 1) ); |
| 810 | } |
| 811 | } |
| 812 | // Repeat the current query stage |
| 813 | GetDriver()->RetryQueryStageComplete( m_nodeId, m_queryStage ); |
| 814 | } |
| 815 | |
| 816 | //----------------------------------------------------------------------------- |
| 817 | // <Node::SetQueryStage> |
no test coverage detected