[INFRA-456] - feat(plane-enterprise): expose gunicorn rotation and Celery broker envs; add PLANE_INTERNAL_API_HOST to pi-api - #271
Conversation
…v vars Add GUNICORN_MAX_REQUESTS, GUNICORN_MAX_REQUESTS_JITTER, CELERY_TASK_PUBLISH_RETRY, and CELERY_BROKER_POOL_LIMIT to the app-vars ConfigMap so operators can tune worker rotation and broker pool behaviour without rebuilding the image. Defaults set to Kubernetes-friendly values (rotation disabled, publish retry enabled, pool bounded to 10) to eliminate the silent task-dispatch failures reported in issue #261. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ERNAL_API_HOST to pi-api Add to app-vars ConfigMap (configurable via values.yaml): - GUNICORN_MAX_REQUESTS (default 0 — rotation disabled, recommended for K8s) - GUNICORN_MAX_REQUESTS_JITTER (default 0) - CELERY_TASK_PUBLISH_RETRY (default True — prevent silent task drops on AMQP reconnect) - CELERY_BROKER_POOL_LIMIT (default 10 — bound connection pool to avoid stale accumulation) Add to pi-api-vars ConfigMap (hardcoded internal cluster URL): - PLANE_INTERNAL_API_HOST — points directly to the in-cluster API service Fixes the silent CSV export failures reported in issue #261 where gunicorn worker rotation caused stale AMQP connections to silently discard published tasks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ETRY Align with existing boolean pattern (ternary without default) so that setting celery_task_publish_retry: false in values.yaml is respected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe enterprise Helm chart adds configurable Gunicorn and Celery environment settings, renders them into application configuration, adds an internal API host, documents the new options, and increments the chart version. ChangesEnterprise chart configuration
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@charts/plane-enterprise/README.md`:
- Around line 503-504: Update the Celery settings entries
env.celery_task_publish_retry and env.celery_broker_pool_limit in the README
configuration documentation to place them in a shared API/worker environment
section or explicitly identify both workloads as consumers. Preserve their
existing defaults and descriptions.
In `@charts/plane-enterprise/templates/config-secrets/app-env.yaml`:
- Line 82: Update the CELERY_BROKER_POOL_LIMIT template expression to preserve
an explicitly configured value of 0 instead of allowing default to replace it
with 10. Use presence-based handling such as hasKey on
.Values.env.celery_broker_pool_limit, while retaining 10 only when the key is
absent.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 30bc2b85-10b9-4fc4-b6b0-7c1bedd3e104
📒 Files selected for processing (6)
charts/plane-enterprise/Chart.yamlcharts/plane-enterprise/README.mdcharts/plane-enterprise/questions.ymlcharts/plane-enterprise/templates/config-secrets/app-env.yamlcharts/plane-enterprise/templates/config-secrets/pi-api-env.yamlcharts/plane-enterprise/values.yaml
…les for improved configuration
…e values for consistency
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
What
Adds 5 new env vars to the
plane-enterprisechart across two ConfigMaps:app-varsConfigMap (templates/config-secrets/app-env.yaml):pi-api-varsConfigMap (templates/config-secrets/pi-api-env.yaml):Defaults declared in
values.yaml; Rancher form entries added inquestions.yml; README table updated.Chart version bumped
3.0.0 → 3.0.2.Why
Reported in #261 (leedsjb): a 50% silent CSV export failure rate caused by two compounding issues:
Gunicorn worker rotation —
--max-requests 1200is hardcoded in the image entrypoint, rotating each worker every ~1,200–2,200 requests. Each rotation produces a ~10–30 s AMQP reconnect window. During that window,task.delay()either hits a broken connection (returning without raising) or writes to a kernel-accepted-but-broker-closed socket — both paths silently discard the task, leaving theexportersrecord stuck in"queued"forever.No publish retry + unbounded broker pool — without
CELERY_TASK_PUBLISH_RETRY, Kombu treats a failed publish as final. Without a pool limit, stale connections accumulate and are reused without health-checking.PLANE_INTERNAL_API_HOSTis added so PI can reach the backend API directly over the cluster network without going through the ingress.Scope / behavior
GUNICORN_MAX_REQUESTS10001200; set to0to disable rotation entirely.GUNICORN_MAX_REQUESTS_JITTER1500when rotation is disabled.CELERY_TASK_PUBLISH_RETRYTrueCELERY_BROKER_POOL_LIMIT100to disable pooling.PLANE_INTERNAL_API_HOSThttp://<release>-api.<ns>.svc.<domain>:8000.GUNICORN_MAX_REQUESTSandGUNICORN_MAX_REQUESTS_JITTERonly take effect if the image entrypoint reads these env vars (the fix in the application image is a prerequisite for the rotation changes to work).CELERY_TASK_PUBLISH_RETRYandCELERY_BROKER_POOL_LIMITare Celery settings consumed by the Django/Celery app directly.PLANE_INTERNAL_API_HOSTis rendered unconditionally wheneverservices.pi.enabled=true(the template is already gated by that condition).Testing
helm lint— clean, 0 failures.helm templateoutput (defaults):helm templatewith--set env.gunicorn_max_requests=0 --set env.gunicorn_max_requests_jitter=0 --set env.celery_task_publish_retry=false --set env.celery_broker_pool_limit=0:Related
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Improvements
1/0values.