@@ -207,14 +207,17 @@ func (e *Engine) ExecuteQuery(ctx context.Context, query *sdp.Query, responses c
207
207
p .Go (func () {
208
208
defer tracing .LogRecoverToReturn (ctx , "ExecuteQuery inner" )
209
209
defer func () {
210
+ // Mark the work as done. This happens before we start
211
+ // waiting on `expandedMutex` below, to ensure that the
212
+ // queues can continue executing even if we are waiting on
213
+ // the mutex.
214
+ wg .Done ()
215
+
210
216
// Delete our query from the map so that we can track which
211
217
// ones are still running
212
218
expandedMutex .Lock ()
213
219
defer expandedMutex .Unlock ()
214
220
delete (expanded , localQ )
215
-
216
- // Mark the work as done
217
- wg .Done ()
218
221
}()
219
222
defer func () {
220
223
if localQ .GetMethod () == sdp .QueryMethod_LIST {
@@ -252,8 +255,10 @@ func (e *Engine) ExecuteQuery(ctx context.Context, query *sdp.Query, responses c
252
255
case <- ctx .Done ():
253
256
// The context was cancelled, this should have propagated to all the
254
257
// adapters and therefore we should see the wait group finish very
255
- // quickly now. We will check this though to make sure
256
- longRunningAdaptersTimeout := 10 * time .Second
258
+ // quickly now. We will check this though to make sure. This will wait
259
+ // until we reach Change Analysis SLO violation territory. If this is
260
+ // too quick, we are only spamming logs for nothing.
261
+ longRunningAdaptersTimeout := 2 * time .Minute
257
262
258
263
// Wait for the wait group, but ping the logs if it's taking
259
264
// too long
0 commit comments