Merge lp:~gholt/swift/late_loadapp into lp:~hudson-openstack/swift/trunk

Proposed by gholt on 2011-04-12
Status: Merged
Approved by: David Goetz on 2011-04-15
Approved revision: 265
Merged at revision: 271
Proposed branch: lp:~gholt/swift/late_loadapp
Merge into: lp:~hudson-openstack/swift/trunk
Diff against target: 23 lines (+4/-2)
1 file modified
swift/common/wsgi.py (+4/-2)
To merge this branch: bzr merge lp:~gholt/swift/late_loadapp
Reviewer Review Type Date Requested Status
Swift Core security contacts 2011-04-12 Pending
Review via email: mp+57261@code.launchpad.net

Description of the change

Move loadapp to after-fork

To post a comment you must log in.
gholt (gholt) wrote :

Don't approve until after Cactus.

lp:~gholt/swift/late_loadapp updated on 2011-04-12
265. By gholt on 2011-04-12

Put early loadapp back in, even though we won't use the result, to test for any instantiation problems early

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'swift/common/wsgi.py'
--- swift/common/wsgi.py 2011-02-14 23:02:08 +0000
+++ swift/common/wsgi.py 2011-04-12 18:31:34 +0000
@@ -124,8 +124,8 @@
124 # remaining tasks should not require elevated privileges124 # remaining tasks should not require elevated privileges
125 drop_privileges(conf.get('user', 'swift'))125 drop_privileges(conf.get('user', 'swift'))
126126
127 # finally after binding to ports and privilege drop, run app __init__ code127 # Ensure the application can be loaded before proceeding.
128 app = loadapp('config:%s' % conf_file, global_conf={'log_name': log_name})128 loadapp('config:%s' % conf_file, global_conf={'log_name': log_name})
129129
130 # redirect errors to logger and close stdio130 # redirect errors to logger and close stdio
131 capture_stdio(logger)131 capture_stdio(logger)
@@ -135,6 +135,8 @@
135 eventlet.hubs.use_hub('poll')135 eventlet.hubs.use_hub('poll')
136 eventlet.patcher.monkey_patch(all=False, socket=True)136 eventlet.patcher.monkey_patch(all=False, socket=True)
137 monkey_patch_mimetools()137 monkey_patch_mimetools()
138 app = loadapp('config:%s' % conf_file,
139 global_conf={'log_name': log_name})
138 pool = GreenPool(size=1024)140 pool = GreenPool(size=1024)
139 try:141 try:
140 wsgi.server(sock, app, NullLogger(), custom_pool=pool)142 wsgi.server(sock, app, NullLogger(), custom_pool=pool)