feat(placement): replace lazy-apps with close-on-exec/need-app in uWSGI#1918
Open
haseebsyed12 wants to merge 1 commit intomainfrom
Open
feat(placement): replace lazy-apps with close-on-exec/need-app in uWSGI#1918haseebsyed12 wants to merge 1 commit intomainfrom
haseebsyed12 wants to merge 1 commit intomainfrom
Conversation
4a55804 to
1572403
Compare
skrobul
reviewed
Apr 9, 2026
Collaborator
skrobul
left a comment
There was a problem hiding this comment.
does this affect only Neutron or all uWSGI based services?
Contributor
It's all services. I originally intended to do Neutron first since that gives us the most problems but it's broken with this setup. Here's my bug report: https://bugs.launchpad.net/devstack/+bug/2147304 and the neutron one: https://bugs.launchpad.net/neutron/+bug/2147305 |
lazy-apps=true was originally added to work around a bug where connections opened during app init (e.g. memcache sockets) were shared between uWSGI workers after forking (LP: #1600394). While effective, it defeats uWSGI's Copy-on-Write optimization from the master process and defers app loading until after fork, meaning a broken application won't be caught until workers try to serve. close-on-exec=true and close-on-exec2=true directly fix the fd-sharing problem by instructing uWSGI to close inherited file descriptors in each worker after forking, without sacrificing CoW. need-app=true causes uWSGI to exit immediately if the application fails to load, rather than leaving the master process running and appearing healthy while workers can't serve requests. This makes failures visible to liveness probes and the process manager. Ref: https://review.opendev.org/c/openstack/devstack/+/983361 Ref: https://bugs.launchpad.net/keystone/+bug/1600394
1572403 to
2ec03fc
Compare
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.
lazy-apps=true was originally added to work around a bug where connections opened during app init (e.g. memcache sockets) were shared between uWSGI workers after forking (LP: #1600394). While effective, it defeats uWSGI's Copy-on-Write optimization from the master process and defers app loading until after fork, meaning a broken application won't be caught until workers try to serve.
close-on-exec=true and close-on-exec2=true directly fix the fd-sharing problem by instructing uWSGI to close inherited file descriptors in each worker after forking, without sacrificing CoW.
need-app=true causes uWSGI to exit immediately if the application fails to load, rather than leaving the master process running and appearing healthy while workers can't serve requests. This makes failures visible to liveness probes and the process manager.
Ref: https://review.opendev.org/c/openstack/devstack/+/983361
Ref: https://bugs.launchpad.net/keystone/+bug/1600394