feat(spider-storage): Add resource group, execution manager and scheduler methods in ServiceState.#323
Conversation
Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com>
Use DbStorage trait bound instead of individual traits, add SessionManagement and DbStorage impls to MockDbConnector; keep detailed mock implementations.
Resolve conflict in job_cache.rs test imports by taking main's version which includes ValidatedJobSubmission and additional cache types.
… ValidatedJobSubmission, session tracking, resource group/execution manager methods, and stale session tests
…llback reads, commit/cleanup task instance methods
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
components/spider-storage/src/state/service.rs (1)
606-619: ⚡ Quick winHeartbeat logs at
infomay be too noisy for a hot path.
update_execution_manager_heartbeatis invoked at the heartbeat cadence per execution manager, so logging atinfofor every successful call will produce a steady stream of log entries proportional to fleet size. Consider lowering todebug(ortrace) so production info-level output stays focused on lifecycle/state-change events. The other new methods in this file already match that intent (e.g.verify_resource_groupdoes not log on success,poll_ready_tasksdoes not log per poll).♻️ Proposed change
self.inner .db .update_execution_manager_heartbeat(execution_manager_id) .await?; - tracing::info!( + tracing::debug!( em_id = ? execution_manager_id, "Execution manager heartbeat updated.", ); Ok(())🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@components/spider-storage/src/state/service.rs` around lines 606 - 619, The heartbeat log in update_execution_manager_heartbeat is too noisy at info level; change the tracing::info! call in that function to a lower level (e.g., tracing::debug! or tracing::trace!) so successful per-heartbeat calls don't flood production logs, preserving the em_id field and the message text; do not alter any other behavior in update_execution_manager_heartbeat and keep consistency with other methods like verify_resource_group and poll_ready_tasks.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@components/spider-storage/src/state/service.rs`:
- Around line 1327-1338: The test poll_ready_tasks_returns_empty_when_no_tasks
currently drops the sender returned by create_test_service_with_real_ready_queue
by binding it to `_`, causing the async_channel to close and recv_batch to
return InternalError::ReadyQueueChannelClosed; keep the sender alive for the
test by binding it to a named variable (e.g., `_sender`) instead of `_` so the
sender lives for the test duration and the assertion can run, mirroring the
pattern used in recv_returns_empty_when_wait_elapses.
---
Nitpick comments:
In `@components/spider-storage/src/state/service.rs`:
- Around line 606-619: The heartbeat log in update_execution_manager_heartbeat
is too noisy at info level; change the tracing::info! call in that function to a
lower level (e.g., tracing::debug! or tracing::trace!) so successful
per-heartbeat calls don't flood production logs, preserving the em_id field and
the message text; do not alter any other behavior in
update_execution_manager_heartbeat and keep consistency with other methods like
verify_resource_group and poll_ready_tasks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e48f7b68-efae-493d-8664-de0aa06fbe6d
📒 Files selected for processing (2)
components/spider-storage/src/state/service.rscomponents/spider-storage/src/state/test_utils.rs
LinZhihao-723
left a comment
There was a problem hiding this comment.
I'm done with my editing. Please check.
Description
As title.
Checklist
breaking change.
Validation performed
Summary by CodeRabbit
Release Notes
New Features
Tests