Skip to content

Commit c3fd332

Browse files
committed
[executor] Increase gRPC dial timeout to workaround slow aliswmod issue
1 parent 595a103 commit c3fd332

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

executor/executorcmd/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const (
5353
ProtobufTransport = ControlTransport(0)
5454
JsonTransport = ControlTransport(1)
5555
)
56+
const GRPC_DIAL_TIMEOUT = 75 * time.Second
57+
// Very long timeout to work around very slow aliswmod issue
5658

5759
func NewClient(controlPort uint64, controlMode controlmode.ControlMode, controlTransport ControlTransport) *RpcClient {
5860
endpoint := fmt.Sprintf("127.0.0.1:%d", controlPort)
@@ -65,7 +67,7 @@ func NewClient(controlPort uint64, controlMode controlmode.ControlMode, controlT
6567
WithField("transport", controlTransportS).
6668
Debug("starting new gRPC client")
6769

68-
cxt, cancel := context.WithTimeout(context.Background(), 20*time.Second)
70+
cxt, cancel := context.WithTimeout(context.Background(), GRPC_DIAL_TIMEOUT)
6971
conn, err := grpc.DialContext(cxt, endpoint, grpc.WithInsecure(), grpc.WithBlock())
7072
if err != nil {
7173
log.WithField("error", err.Error()).

0 commit comments

Comments
 (0)