-
Notifications
You must be signed in to change notification settings - Fork 129
chore(pegboard): allow configuring base_retry_timeout, actor_start_threshold, actor_stop_threshold, and retry_reset_duration #3354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
Code ReviewSummaryThis PR refactors hard-coded timeout constants in the Pegboard actor workflow system into configurable parameters. This is a solid improvement that increases flexibility for different deployment environments. ✅ Strengths
🔍 Issues & Suggestions1. Type Inconsistencypub base_retry_timeout: Option<usize>, // usize
pub actor_start_threshold: Option<i64>, // i64
pub actor_stop_threshold: Option<i64>, // i64
pub retry_reset_duration: Option<i64>, // i64Issue: Recommendation: Consider using 2. Parameter Passing in
|
8f9ad21 to
91b48b3
Compare
PR Review: Configure Pegboard Actor Timeouts and Retry ParametersSummaryThis PR extracts hard-coded constants for actor lifecycle timeouts and retry behavior into configurable parameters. The changes enable runtime configuration of:
Code Quality ✅Strengths:
Minor observations:
Potential Issues 🔍1. Type inconsistency in defaults (Minor) // In pegboard.rs:36
self.base_retry_timeout.unwrap_or(2000)
// vs in pegboard.rs:40
self.actor_start_threshold.unwrap_or(30_000)The use of underscores for readability is inconsistent. Consider: self.base_retry_timeout.unwrap_or(2_000) // Add underscore for consistency2. Missing validation (Low priority)
This is likely fine for experimental parameters, but worth considering for production. 3. No migration path documented (Documentation)
Performance Considerations ⚡Positive:
Neutral:
Security Concerns 🔒Low risk:
Consideration:
Test Coverage 📋Observation:
This is acceptable, though consider:
Architecture & Design 🏗️Excellent:
Threading config through the codebase:
This is the correct pattern for this codebase. Recommendations 📝
Verdict ✨Approved - This is a clean, well-structured change that maintains backwards compatibility while adding needed flexibility. The code follows repository conventions and the refactoring is straightforward. The minor suggestions above are optional improvements that don't block merging. Review generated by Claude Code |
PR Review: Configurable Pegboard TimeoutsSummaryThis PR extracts hardcoded timeout constants into configuration options for the Pegboard actor management system. The change allows for runtime configuration of retry timeouts, actor start/stop thresholds, and retry reset duration. Code Quality ✅Strengths:
Consistency:
Potential Issues 🔍1. Type Inconsistency (Minor)
2. Magic Numbers in Defaults
Performance Considerations ✅
Security Concerns ✅
Test Coverage
|
63252c2 to
7547022
Compare
91b48b3 to
1527e67
Compare
Code ReviewThis PR makes Pegboard actor lifecycle configuration tunable by moving hard-coded constants into a new configuration structure. Overall, the implementation is clean and well-structured. Here are my findings: Strengths
Issues and Recommendations1. Type Inconsistency (Minor Bug Risk)
engine/packages/config/src/config/pegboard.rs:12 pub base_retry_timeout: Option<usize>,vs. engine/packages/config/src/config/pegboard.rs:18,24,31 pub actor_start_threshold: Option<i64>,
pub actor_stop_threshold: Option<i64>,
pub retry_reset_duration: Option<i64>,Recommendation: Consider using 2. Missing Constants DocumentationThe old constants had inline comments explaining their purpose. When removing them, the context is now only in the config file comments, which might not be visible to developers reading the workflow code. engine/packages/pegboard/src/workflows/actor/mod.rs:10-12 (removed) - /// Time to delay an actor from rescheduling after a rescheduling failure.
- const BASE_RETRY_TIMEOUT_MS: usize = 2000;Recommendation: Consider adding a brief comment where these values are used, e.g.: // Get retry timeout from config (experimental tunable parameter)
let mut backoff = reschedule_backoff(
state.reschedule_state.retry_count,
ctx.config().pegboard().base_retry_timeout(),
);3. Magic Number in Default Valueengine/packages/config/src/config/pegboard.rs:48 pub fn retry_reset_duration(&self) -> i64 {
self.retry_reset_duration.unwrap_or(10 * 60 * 1000)
}Recommendation: Consider using 4. Experimental Features - Testing ConcernAll four parameters are marked as Recommendation: Add integration or unit tests that:
5. Config Validation MissingThere's no validation for these timeout values. Invalid values (e.g., negative numbers for i64 fields, or extremely small values) could cause unexpected behavior. Recommendation: Add validation in the config module: impl Pegboard {
pub fn validate(&self) -> Result<(), &'static str> {
if let Some(t) = self.actor_start_threshold {
if t <= 0 { return Err("actor_start_threshold must be positive"); }
}
// Similar for other fields
Ok(())
}
}Performance ConsiderationsNo performance concerns - the config values are cached via Security ConsiderationsNo security issues identified. These are internal operational parameters. Code QualityStyle adherence: Code follows the CLAUDE.md conventions:
Minor: Import reordering in runtime.rs:1-2 (base64 imports) - this is fine but appears to be an incidental formatting change. Test CoverageSummaryThe implementation is solid and well-integrated. The main concerns are:
Recommendation: Approve with minor changes - consider addressing type consistency and adding basic validation before merge. Tests can be added in a follow-up PR if needed. |
Code Review for PR #3354SummaryThis PR makes several hardcoded Pegboard timeout and retry parameters configurable through the config system. The implementation follows the existing configuration patterns and appears to be well-structured. Positive Aspects ✅
Issues & Recommendations 🔍1. Type Inconsistency
|
1527e67 to
5ed524d
Compare
4d3c3c9 to
b8fface
Compare
5ed524d to
6bc2a41
Compare
Pull Request ReviewThis PR adds configurable timeouts and retry parameters for the Pegboard actor system, moving hardcoded constants into the configuration layer. Overall, the implementation is solid and follows the repository conventions well. ✅ Strengths
🔍 Issues & Suggestions1. Type Inconsistency
|
…reshold, actor_stop_threshold, and retry_reset_duration
6bc2a41 to
3e43c22
Compare
Code ReviewSummaryThis PR converts hardcoded Pegboard actor lifecycle timeouts and retry configurations into configurable parameters. The changes look clean and follow good practices overall. ✅ Strengths
🔍 Minor Observations
🎯 Suggestions (Optional)Consider adding validation in
Example: // In Root::validate_and_set_defaults()
let pegboard = self.pegboard();
if pegboard.actor_start_threshold() < 1000 {
bail!("actor_start_threshold must be at least 1000ms");
}However, since these are marked Experimental, validation might not be necessary yet. ✅ VerdictLGTM - This is a well-executed refactoring that:
The code is production-ready as-is. The optional suggestions above are enhancements that could be added in a follow-up if desired. |
Merge activity
|
…reshold, actor_stop_threshold, and retry_reset_duration (#3354)

No description provided.