-
Notifications
You must be signed in to change notification settings - Fork 231
Open
Description
Description:
In the following code snippet:
foreach(taskCell, taskList)
{
CronTask *task = (CronTask *) lfirst(taskCell);
PostgresPollingStatusType pollingStatus = task->pollingStatus;
struct pollfd *pollFileDescriptor = &pollFDs[activeTaskCount];
if (activeTaskCount >= max_running_tasks)
{
/* already polling the maximum number of tasks */
break;
}
}It seems that any task beyond the max_running_tasks limit never gets a chance to execute, because the loop breaks as soon as the active task count reaches the limit. This raises the concern that tasks later in the list might be completely ignored, especially if activeTaskCount is never decremented or reset elsewhere for polling new tasks.
Could you clarify:
• Is there any logic that allows the skipped tasks to be retried in a subsequent cycle?
• If not, should the code be changed to process all tasks, even if only a limited number can be active at a time?
This might lead to starvation for tasks that are always queued behind the currently running ones.
Thanks!
Metadata
Metadata
Assignees
Labels
No labels