@@ -83,6 +83,8 @@ pub trait QueueData: Send + Sync + 'static {
83
83
84
84
fn enter_wait_pending ( & self ) { }
85
85
86
+ fn set_status ( & self , _status : & str ) { }
87
+
86
88
fn exit_wait_pending ( & self , _wait_time : Duration ) { }
87
89
88
90
fn get_abort_notify ( & self ) -> Arc < WatchNotify > ;
@@ -224,19 +226,23 @@ impl<Data: QueueData> QueueManager<Data> {
224
226
workload_group_timeout = std:: cmp:: min ( queue_timeout, workload_group_timeout) ;
225
227
}
226
228
229
+ data. set_status ( "[QUERY-QUEUE] Waiting for local workload semaphore" ) ;
230
+
227
231
let semaphore = workload_group. semaphore . clone ( ) ;
228
232
let acquire = tokio:: time:: timeout ( timeout, semaphore. acquire_owned ( ) ) ;
229
233
let queue_future = AcquireQueueFuture :: create ( data. clone ( ) , acquire, self . clone ( ) ) ;
230
234
231
235
guards. push ( queue_future. await ?) ;
232
236
233
237
info ! (
234
- "[QUERY-QUEUE] Successfully acquired from workload local group queue . elapsed: {:?}" ,
238
+ "[QUERY-QUEUE] Successfully acquired from local workload semaphore . elapsed: {:?}" ,
235
239
instant. elapsed( )
236
240
) ;
237
241
238
242
timeout -= instant. elapsed ( ) ;
239
243
244
+ data. set_status ( "[QUERY-QUEUE] Waiting for global workload semaphore" ) ;
245
+
240
246
let workload_queue_guard = self
241
247
. acquire_workload_queue (
242
248
data. clone ( ) ,
@@ -247,14 +253,16 @@ impl<Data: QueueData> QueueManager<Data> {
247
253
. await ?;
248
254
249
255
info ! (
250
- "[QUERY-QUEUE] Successfully acquired from workload meta group queue . elapsed: {:?}" ,
256
+ "[QUERY-QUEUE] Successfully acquired from global workload semaphore . elapsed: {:?}" ,
251
257
instant. elapsed( )
252
258
) ;
253
259
timeout -= instant. elapsed ( ) ;
254
260
guards. push ( workload_queue_guard) ;
255
261
}
256
262
}
257
263
264
+ data. set_status ( "[QUERY-QUEUE] Waiting for warehouse resource scheduling" ) ;
265
+
258
266
guards. extend ( self . acquire_warehouse_queue ( data, timeout) . await ?) ;
259
267
260
268
inc_session_running_acquired_queries ( ) ;
@@ -692,6 +700,10 @@ impl QueueData for QueryEntry {
692
700
. set_status_info ( "[QUERY-QUEUE] Waiting for resource scheduling" ) ;
693
701
}
694
702
703
+ fn set_status ( & self , status : & str ) {
704
+ self . ctx . set_status_info ( status) ;
705
+ }
706
+
695
707
fn exit_wait_pending ( & self , wait_time : Duration ) {
696
708
self . ctx . set_status_info (
697
709
format ! (
0 commit comments