fix: Scheduler fetch task when no task to schedule - #85
Conversation
WalkthroughThis pull request updates the task scheduling in the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller as Scheduler
participant Fifo as FifoPolicy
participant TaskQ as Task Queue
Caller->>Fifo: schedule_next(worker_addr)
Fifo->>Fifo: pop_next_task(worker_addr)
alt Task found
Fifo-->>Caller: return task ID
else No task found
Fifo->>TaskQ: fetch tasks/update m_tasks
alt Task list unchanged
Fifo-->>Caller: return std::nullopt
else Task list updated
Fifo->>Fifo: pop_next_task(worker_addr) attempt again
Fifo-->>Caller: return task ID or std::nullopt
end
end
Possibly Related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code Definitions (1)src/spider/scheduler/FifoPolicy.cpp (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Description
The FIFO scheduler only fetch tasks when local task queue is empty. However, in the case where idle workers are not assigned tasks due to locality constraints, it is possible that local task queue is not empty but new ready tasks are pushed to storage.
This pr changes the scheduler behavior to fetch task each time there is no task to schedule.
Checklist
breaking change.
Validation performed
Summary by CodeRabbit