fix(gcp): use redis backend for celery autoscaler when broker is redis#803
Merged
arniechops merged 2 commits intomainfrom Apr 5, 2026
Merged
Conversation
lilyz-ai
approved these changes
Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
redis, the autoscaler callscelery_app()without specifyingbackend_protocol, which defaults to"s3"ProfileNotFound: The config profile (default) could not be foundcelery-autoscaler-redisto CrashLoopBackOff on GCP clustersbackend_protocol="redis"when broker is redis (matching how theservicebuspath already passesbackend_protocol="abs")Test plan
celery-autoscaler-redis-0starts without crash-loopingGreptile Summary
This PR fixes a GCP-specific crash in the
celery-autoscaler-redispod by passingbackend_protocol="redis"when constructing the Celery inspect app for the Redis broker path. Previously, the code fell back to the defaultbackend_protocol="s3", which triggered a boto3 AWS session initialization (via_get_backend_url_and_conf) that fails on GCP withProfileNotFound.Key changes:
broker_type == "redis"branch ofmain(),celery_app()is now called withbackend_protocol="redis", consistent with how theservicebusbranch already passesbackend_protocol="abs"._get_backend_url_and_conffunction shows that"redis"backend resolves toget_redis_endpoint(1)(db index 1), which is a valid, always-available endpoint in a Redis-based deployment.Confidence Score: 5/5
Safe to merge — targeted one-line fix that correctly mirrors the existing servicebus pattern and avoids a well-understood crash on GCP.
The change is small, well-motivated, and aligns with the existing convention (servicebus uses backend_protocol='abs'). The backend_protocol='redis' path in _get_backend_url_and_conf is straightforward and does not touch AWS credentials. The only remaining feedback is a P2 style suggestion to add a clarifying comment. No logic or correctness issues found.
No files require special attention — the single changed file is straightforward.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[main: autoscaler_broker] --> B{broker_type?} B -- redis --> C["celery_app with backend_protocol='redis'"] B -- sqs --> D["inspect = empty, reads directly from SQS"] B -- servicebus --> E["celery_app with backend_protocol='abs'"] C --> F[_get_backend_url_and_conf] E --> F F -- redis --> G["get_redis_endpoint db=1, no AWS session needed"] F -- s3 old default --> H{cloud_provider?} H -- aws --> I["session + boto3, works on AWS"] H -- gcp --> J["boto3 default profile, ProfileNotFound crash on GCP"] F -- abs --> K["azureblockblob URL, no AWS session needed"]Prompt To Fix All With AI
Reviews (2): Last reviewed commit: "fix" | Re-trigger Greptile