@@ -121,6 +121,8 @@ public enum DeleteState {
121
121
122
122
private MarkedCountDownLatch <Long , Long > countDownLatch ;
123
123
124
+ private long timeoutS = 300L ;
125
+
124
126
public DeleteJob (long id , long transactionId , String label ,
125
127
Map <Long , Short > partitionReplicaNum , DeleteInfo deleteInfo ) {
126
128
this .id = id ;
@@ -251,14 +253,16 @@ public Collection<TabletDeleteInfo> getTabletDeleteInfo() {
251
253
return tabletDeleteInfoMap .values ();
252
254
}
253
255
256
+ public void setTimeoutS (long timeoutS ) {
257
+ this .timeoutS = timeoutS ;
258
+ }
259
+
254
260
public long getTimeoutMs () {
255
261
if (FeConstants .runningUnitTest ) {
256
262
// for making unit test run fast
257
263
return 1000 ;
258
264
}
259
- // timeout is between 30 seconds to 5 min
260
- long timeout = Math .max (totalTablets .size () * Config .tablet_delete_timeout_second * 1000L , 30000L );
261
- return Math .min (timeout , Config .delete_job_max_timeout_second * 1000L );
265
+ return timeoutS * 1000L ;
262
266
}
263
267
264
268
public void setTargetDb (Database targetDb ) {
@@ -563,6 +567,10 @@ public DeleteJob buildWith(BuildParams params) throws Exception {
563
567
deleteJob .setTargetDb (params .getDb ());
564
568
deleteJob .setTargetTbl (params .getTable ());
565
569
deleteJob .setCountDownLatch (new MarkedCountDownLatch <>((int ) replicaNum ));
570
+ ConnectContext connectContext = ConnectContext .get ();
571
+ if (connectContext != null ) {
572
+ deleteJob .setTimeoutS (connectContext .getExecTimeout ());
573
+ }
566
574
return deleteJob ;
567
575
}
568
576
0 commit comments