lucasbru opened a new pull request, #14180:
URL: https://github.com/apache/kafka/pull/14180

   Avoid busy waiting for processable tasks. We need to be a bit careful here 
to not have the task executors to sleep when work is available. We have to make 
sure to signal on the condition variable any time a task becomes "processable". 
Here are some situations where a task becomes processable:
   
   - Task is unassigned from another `TaskExecutor`.
   - Task state is changed (should only happen inside when a task is locked 
inside the polling phase).
   - When tasks are unlocked.
   - When tasks are added.
   - New records available.
   - A task is resumed.
   
   So in summary, we
   
   - We should probably lock tasks when they are paused and unlock them when 
they are resumed. We should also wake the task executors after every polling 
phase. This belongs to the StreamThread integration work (separate PR). We add 
`DefaultTaskManager.signalProcessableTasks` for this.
   - We need to awake the task executors in `DefaultTaskManager.unassignTask`, 
`DefaultTaskManager.unlockTasks` and `DefaultTaskManager.add`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to