Skip to content

Commit

Permalink
Add a timeout for initial request to peer when initiating shard trans…
Browse files Browse the repository at this point in the history
…fer (to request whether we can proceed with a snapshot transfer)

Summary: as title

Reviewed By: hsun324

Differential Revision:
D67112459

Privacy Context Container: L1141030

fbshipit-source-id: bc368c9c35ebeec58e035ad979bd6aed8a2b196e
  • Loading branch information
Jose-Angel Herrero Bajo authored and facebook-github-bot committed Dec 12, 2024
1 parent bab99d4 commit 9722dc8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/wa_raft.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
-define(RAFT_METRICS_MODULE(), ?RAFT_CONFIG(raft_metrics_module)).

%% Default Call timeout for all cross node gen_server:call
-define(RAFT_RPC_CALL_TIMEOUT(), ?RAFT_CONFIG(raft_rpc_call_timeout, 30000)).
-define(RAFT_RPC_CALL_TIMEOUT(), ?RAFT_CONFIG(raft_rpc_call_timeout, 10000)).
%% Default call timeout for storage related operation (we need bigger default since storage can be slower)
-define(RAFT_STORAGE_CALL_TIMEOUT(), ?RAFT_CONFIG(raft_storage_call_timeout, 60000)).

Expand Down
2 changes: 1 addition & 1 deletion src/wa_raft_transport.erl
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ handle_transport_start(From, Peer, Meta, Root, Counters) ->

% Notify peer node of incoming transport
FileData = [{FileID, Filename, Size} || {FileID, Filename, _, _, Size} <- Files],
case gen_server:call({?MODULE, Peer}, {transport, ID, node(), Module, Meta, FileData}) of
case gen_server:call({?MODULE, Peer}, {transport, ID, node(), Module, Meta, FileData}, ?RAFT_RPC_CALL_TIMEOUT()) of
ok ->
% Add all files to the queue
ets:insert(Queue, [{FileID} || {FileID, _, _, _, _} <- Files]),
Expand Down

0 comments on commit 9722dc8

Please sign in to comment.