Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce sync timeout error level to debug #4215

Merged
merged 1 commit into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the Nethermind. If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -49,8 +50,16 @@ protected override async Task Dispatch(PeerInfo peerInfo, BodiesSyncBatch batch,
if (Logger.IsDebug) Logger.Debug($"{batch} - attempted send a request with no hash.");
return;
}

batch.Response = await peer.GetBlockBodies(hashes, cancellationToken);

try
{
batch.Response = await peer.GetBlockBodies(hashes, cancellationToken);
}
catch (TimeoutException)
{
if (Logger.IsDebug) Logger.Debug($"{batch} - Get block bodies timeout {batch.RequestTime:F2}");
return;
}
if (batch.RequestTime > 1000)
{
if (Logger.IsDebug) Logger.Debug($"{batch} - peer is slow {batch.RequestTime:F2}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the Nethermind. If not, see <http://www.gnu.org/licenses/>.

using System;
using System.Threading;
using System.Threading.Tasks;
using Nethermind.Blockchain.Synchronization;
Expand Down Expand Up @@ -43,8 +44,16 @@ protected override async Task Dispatch(
ISyncPeer peer = peerInfo.SyncPeer;
batch.ResponseSourcePeer = peerInfo;
batch.MarkSent();

batch.Response = await peer.GetBlockHeaders(batch.StartNumber, batch.RequestSize, 0, cancellationToken);

try
{
batch.Response = await peer.GetBlockHeaders(batch.StartNumber, batch.RequestSize, 0, cancellationToken);
}
catch (TimeoutException)
{
if (Logger.IsDebug) Logger.Debug($"{batch} - request block header timeout {batch.RequestTime:F2}");
return;
}
if (batch.RequestTime > 1000)
{
if (Logger.IsDebug) Logger.Debug($"{batch} - peer is slow {batch.RequestTime:F2}");
Expand Down