Skip to content

Commit

Permalink
IS 495 change timeouts only for sync nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
olehnikolaiev committed Dec 26, 2024
1 parent 1eeea96 commit 8e5f6f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion catchup/client/CatchupClientAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ nlohmann::json CatchupClientAgent::readCatchupResponseHeader(
const ptr< ClientSocket >& _socket, ptr< CatchupRequestHeader > _requestHeader ) {
CHECK_ARGUMENT( _socket )
CHECK_ARGUMENT( _requestHeader )
uint32_t timeoutSec = getNode()->isSyncOnlyNode() ? 300 : 30;
auto result = sChain->getIo()->readJsonHeader( _socket->getDescriptor(),
"Read catchup response", 300, _socket->getIP(), MAX_CATCHUP_DOWNLOAD_BYTES );
"Read catchup response", timeoutSec, _socket->getIP(), MAX_CATCHUP_DOWNLOAD_BYTES );
return result;
}

Expand Down
3 changes: 2 additions & 1 deletion network/IO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ nlohmann::json IO::readJsonHeader( file_descriptor descriptor, const char* _erro
auto buf2 = make_shared< vector< uint8_t > >( sizeof( uint64_t ) );

try {
readBytes( descriptor, buf2, msg_len( sizeof( uint64_t ) ), 300 );
uint32_t timeoutSec = sChain->getNode()->isSyncOnlyNode() ? 300 : 6;
readBytes( descriptor, buf2, msg_len( sizeof( uint64_t ) ), timeoutSec );
} catch ( ExitRequestedException& ) {
throw;
} catch ( ... ) {
Expand Down

0 comments on commit 8e5f6f2

Please sign in to comment.