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

Template Rendering Shows Stale Content with Multiple Gunicorn Workers(docker+django+gunicorn) #3282

Open
FrankFang0813 opened this issue Aug 20, 2024 · 3 comments

Comments

@FrankFang0813
Copy link

Hi I have a Issue,
When running a Django application with multiple Gunicorn workers, I encounter an issue where template rendering shows stale content. Specifically, after navigating from one URL (e.g., foo/123) to another (e.g., foo/456), the rendered page sometimes displays content from the previous URL (foo/123) instead of the current one. This issue does not occur when only a single worker is configured.

Thank you!

@benoitc
Copy link
Owner

benoitc commented Aug 20, 2024 via email

@FrankFang0813
Copy link
Author

I'm using Dash to build my layout, and my URLs are dynamically generated. I've verified that the parameters( request and context) passed during render are correct.

However, when I use multiple workers, the URL are correct, but the displayed page shows the content from the previous URL.

When I use a single worker, this issue doesn't occur.

@pajod
Copy link
Contributor

pajod commented Aug 20, 2024

I could imagine a number of ways how this could go wrong, including but not limited to:

  • the requests being entirely correct, but a Javascript front-end failing to update interface after faking navigation
  • thread safety flaws in generating the dynamically generated URL
  • cross-thread synchronization flaws in propagating the link between URL and content
  • caching or state sharing mechanism storing or retrieving data on inappropriate keys
  • HTTP request and/or response de-sync between some front-end proxy and Gunicorn
    Only the last example would indicate a (serious) bug in Gunicorn.

You need to provide enough code and the method of deployment to review or reproduce.

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

No branches or pull requests

3 participants