@@ -125,6 +125,7 @@ const (
125
125
readyToCompleteHint = "ready_to_complete"
126
126
databasePoolSize = 3
127
127
qrBufferExtraTimeout = 5 * time .Second
128
+ grpcTimeout = 30 * time .Second
128
129
vreplicationTestSuiteWaitSeconds = 5
129
130
)
130
131
@@ -737,9 +738,6 @@ func (e *Executor) primaryPosition(ctx context.Context) (pos mysql.Position, err
737
738
738
739
// terminateVReplMigration stops vreplication, then removes the _vt.vreplication entry for the given migration
739
740
func (e * Executor ) terminateVReplMigration (ctx context.Context , uuid string ) error {
740
- tmClient := e .tabletManagerClient ()
741
- defer tmClient .Close ()
742
-
743
741
tablet , err := e .ts .GetTablet (ctx , e .tabletAlias )
744
742
if err != nil {
745
743
return err
@@ -918,11 +916,13 @@ func (e *Executor) cutOverVReplMigration(ctx context.Context, s *VReplStream) er
918
916
919
917
e .toggleBufferTableFunc (bufferingCtx , onlineDDL .Table , timeout , bufferQueries )
920
918
if ! bufferQueries {
919
+ grpcCtx , cancel := context .WithTimeout (ctx , grpcTimeout )
920
+ defer cancel ()
921
921
// called after new table is in place.
922
922
// unbuffer existing queries:
923
923
bufferingContextCancel ()
924
924
// force re-read of tables
925
- if err := tmClient .RefreshState (ctx , tablet .Tablet ); err != nil {
925
+ if err := tmClient .RefreshState (grpcCtx , tablet .Tablet ); err != nil {
926
926
return err
927
927
}
928
928
}
@@ -3754,7 +3754,10 @@ func (e *Executor) vreplicationExec(ctx context.Context, tablet *topodatapb.Tabl
3754
3754
tmClient := e .tabletManagerClient ()
3755
3755
defer tmClient .Close ()
3756
3756
3757
- return tmClient .VReplicationExec (ctx , tablet , query )
3757
+ grpcCtx , cancel := context .WithTimeout (ctx , grpcTimeout )
3758
+ defer cancel ()
3759
+
3760
+ return tmClient .VReplicationExec (grpcCtx , tablet , query )
3758
3761
}
3759
3762
3760
3763
// reloadSchema issues a ReloadSchema on this tablet
@@ -3766,7 +3769,11 @@ func (e *Executor) reloadSchema(ctx context.Context) error {
3766
3769
if err != nil {
3767
3770
return err
3768
3771
}
3769
- return tmClient .ReloadSchema (ctx , tablet .Tablet , "" )
3772
+
3773
+ grpcCtx , cancel := context .WithTimeout (ctx , grpcTimeout )
3774
+ defer cancel ()
3775
+
3776
+ return tmClient .ReloadSchema (grpcCtx , tablet .Tablet , "" )
3770
3777
}
3771
3778
3772
3779
// deleteVReplicationEntry cleans up a _vt.vreplication entry; this function is called as part of
0 commit comments