Skip to content

fix: make workflow worker batch size configurable#196

Merged
vizsatiz merged 1 commit into
developfrom
fix/workflow-worker-count
Dec 22, 2025
Merged

fix: make workflow worker batch size configurable#196
vizsatiz merged 1 commit into
developfrom
fix/workflow-worker-count

Conversation

@vishnurk6247
Copy link
Copy Markdown
Member

@vishnurk6247 vishnurk6247 commented Dec 21, 2025

Summary by CodeRabbit

  • Improvements
    • Batch size for workflow job processing is now configurable through application settings rather than using a fixed value.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 21, 2025

Walkthrough

Configuration externalization: A hardcoded batch size value (5) in the workflow job is replaced with a dynamic configuration parameter. The batch_size option is added to config.ini and read at runtime from main.py, allowing environment-based customization without code changes.

Changes

Cohort / File(s) Summary
Batch Size Configuration Externalization
wavefront/server/background_jobs/workflow_job/workflow_job/config.ini, wavefront/server/background_jobs/workflow_job/workflow_job/main.py
Added batch_size configuration option with default value 5 in config.ini; updated main.py to read streaming_batch_size from configuration instead of using hardcoded constant.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Configuration addition is straightforward with sensible defaults
  • Single line modification in main.py to read from config (minimal logic change)

Poem

🐰 A batch size once rigid and bound,
Now flexes through config, so sound!
No hardcoding's chains,
Just environment's gains,
Configuration magic, we've found! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: making the workflow worker batch size configurable by moving it from a hardcoded value to a configuration parameter.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/workflow-worker-count

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
wavefront/server/background_jobs/workflow_job/workflow_job/main.py (1)

106-106: LGTM! Change follows existing configuration patterns.

The dynamic batch size configuration is implemented consistently with the thread_count pattern (line 109) and replaces the hardcoded value with a configurable option.

Optional: Consider adding validation for positive batch size values.

StreamListener.__init__ accepts streaming_batch_size without validation. Adding a check like:

if batch_size <= 0:
    raise ValueError(f"batch_size must be positive, got {batch_size}")

would prevent edge cases from propagating to event_manager.receive_messages().

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a205861 and 2df4c9a.

📒 Files selected for processing (2)
  • wavefront/server/background_jobs/workflow_job/workflow_job/config.ini (1 hunks)
  • wavefront/server/background_jobs/workflow_job/workflow_job/main.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-push-artifact
🔇 Additional comments (1)
wavefront/server/background_jobs/workflow_job/workflow_job/config.ini (1)

5-5: LGTM! Configuration follows established patterns.

The new batch_size configuration option follows the same pattern as other config values (e.g., thread_count), using environment variable substitution with a sensible default of 5.

@vizsatiz vizsatiz merged commit 3c3c730 into develop Dec 22, 2025
9 checks passed
@vizsatiz vizsatiz deleted the fix/workflow-worker-count branch December 22, 2025 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants