Loading

Apex Jobs using Flex Queue are in Holding state

Дата публикации: May 2, 2023
Описание
When Flex Queues are used to submit batch jobs simultaneously, you will observe that the Jobs  in the Flex Queue will be in Holding Status. 

This would give an impression that they are stuck because of being in Holding status, but they are not. It is how the Flex Queue works. 
 
Решение
In general, a Batch Job which has not started yet will default the status of Queued. The batch which is currently being processed will be in the InProgress status.  Batch jobs usually have the limit of five queued or active jobs simultaneously. 
With Flex Queues, any jobs that are submitted for execution but are not processed immediately by the system go in holding status and are placed in a separate queue (the Apex flex queue).

Up to 100 batch jobs can be in the holding status. When system resources become available, the system picks up jobs from the Apex flex queue and moves them to the batch job queue. The status of these moved jobs changes from Holding to Queued. Queued jobs get executed when the system is ready to process new jobs and they will then go to InProgress status.

This would give an impression that a lot of jobs are in holding status and are stuck.
They actually are placed in the Apex flex queue and are waiting to be picked up when system resources are available. Please review Asynchronous Processing to know more about the nature of behavior in a multi-tenant environment. 

Please Note: Since Batch is an Asynchronous process, there is no ETA for the time taken by a Job to move from Queued state to processing state , it total depends on the system resources availability during that moment.

The following links should give you more insight into this:
Monitor the Apex Flex Queue
Using Batch Apex


 
Номер статьи базы знаний

000386672

 
Загрузка
Salesforce Help | Article