Skip to content
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

fix: Avoid loading Django settings in Gunicorn #3685

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Mar 27, 2024

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

We had a report of segfaults happening due to Gunicorn using the util.logging.GunicornJsonCapableLogger class. I determined the problematic code to be the Django settings retrieval in the setup method. This PR makes the logger class skip Django settings during setup.

How did you test this code?

The original reporter applied this change and confirmed no segfaults happening anymore.

@khvn26 khvn26 requested review from a team and matthewelwell and removed request for a team March 27, 2024 15:28
Copy link

vercel bot commented Mar 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Mar 27, 2024 3:28pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview Mar 27, 2024 3:28pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview Mar 27, 2024 3:28pm

@github-actions github-actions bot added the api Issue related to the REST API label Mar 27, 2024
@khvn26 khvn26 added this pull request to the merge queue Mar 27, 2024
Merged via the queue into main with commit 7c65445 Mar 27, 2024
22 checks passed
@khvn26 khvn26 deleted the fix/django-settings-gunicorn branch March 27, 2024 15:30
matthewelwell added a commit that referenced this pull request Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants