309
// Stop does not unload the partition from matching engine. It is intended to be called by matching engine when
310
// unloading the partition. For stopping and unloading a partition call unloadFromEngine instead.
312
>
pm.initCancel()
313
>
queue, err := pm.defaultQueueFuture.Get(context.Background())
314
>
if err == nil {
315
>
queue.Stop(unloadCause)
316
>
pm.emitZeroLogicalBacklogForQueue(queue.QueueKey().Version(), queue)
317
>
}
318
320
pm.cancelFairnessSub()
321
}
323
pm.cancelNewMatcherSub()
324
}
326
pm.cancelAutoEnableSub()
327
}
329
>
330
>
pm.versionedQueuesLock.Lock()
331
>
for version, vq := range pm.versionedQueues {
332
vq.Stop(unloadCause)
333
pm.emitZeroLogicalBacklogForQueue(version, vq)
334
}
336
>
337
>
for _, hook := range pm.taskHooks {
338
hook.Stop()
339
}
340
341
// Then, stop user data manager to wrap up any reads/writes.
343
>
344
>
// Finally, stop rate limit manager (used by queues and using user data manager).
345
>
pm.rateLimitManager.Stop()
346
>
347
>
pm.engine.updateTaskQueuePartitionGauge(pm.Namespace(), pm.partition, -1)
348
>
349
>
pm.goroGroup.Cancel()
350
}
351