@@ -87,13 +87,13 @@ MPPGatherTaskSetPtr MPPQuery::addMPPGatherTaskSet(const MPPGatherId & gather_id)
8787void MPPTaskMonitor::waitAllMPPTasksFinish (const std::unique_ptr<Context> & context)
8888{
8989 // The maximum seconds TiFlash will wait for all current MPP tasks to finish before shutting down
90- static constexpr const char * GRACEFUL_WIAT_BEFORE_SHUTDOWN = " flash.graceful_wait_before_shutdown " ;
91- // The default value of flash.graceful_wait_before_shutdown
92- static constexpr UInt64 DEFAULT_GRACEFUL_WAIT_BEFORE_SHUTDOWN = 600 ;
93- auto graceful_wait_before_shutdown
94- = context->getUsersConfig ()->getUInt64 (GRACEFUL_WIAT_BEFORE_SHUTDOWN , DEFAULT_GRACEFUL_WAIT_BEFORE_SHUTDOWN );
95- LOG_INFO (log, " Start to wait all MPPTasks to finish, timeout={}s" , graceful_wait_before_shutdown );
96- UInt64 graceful_wait_before_shutdown_ms = graceful_wait_before_shutdown * 1000 ;
90+ static constexpr const char * GRACEFUL_WAIT_SHUTDOWN_TIMEOUT = " flash.graceful_wait_shutdown_timeout " ;
91+ // The default value of flash.graceful_wait_shutdown_timeout
92+ static constexpr UInt64 DEFAULT_GRACEFUL_WAIT_SHUTDOWN_TIMEOUT = 600 ;
93+ auto graceful_wait_shutdown_timeout
94+ = context->getUsersConfig ()->getUInt64 (GRACEFUL_WAIT_SHUTDOWN_TIMEOUT , DEFAULT_GRACEFUL_WAIT_SHUTDOWN_TIMEOUT );
95+ LOG_INFO (log, " Start to wait all MPP tasks to finish, timeout={}s" , graceful_wait_shutdown_timeout );
96+ UInt64 graceful_wait_shutdown_timeout_ms = graceful_wait_shutdown_timeout * 1000 ;
9797 Stopwatch watch;
9898 // The first sleep before checking to reduce the chance of missing MPP tasks that are still in the process of being dispatched
9999 std::this_thread::sleep_for (std::chrono::seconds (1 ));
@@ -116,7 +116,7 @@ void MPPTaskMonitor::waitAllMPPTasksFinish(const std::unique_ptr<Context> & cont
116116 break ;
117117 }
118118 }
119- if (elapsed_ms >= graceful_wait_before_shutdown_ms )
119+ if (elapsed_ms >= graceful_wait_shutdown_timeout_ms )
120120 {
121121 LOG_WARNING (log, " Timed out waiting for all MPP tasks to finish after {}ms" , elapsed_ms);
122122 break ;
0 commit comments