r36753 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36752‎ | r36753 | r36754 >
Date:15:36, 27 June 2008
Author:jojo
Status:old
Tags:
Comment:
introduce timeout again. instead do not wait for mw-zip/mw-render to return (even with --daemonize) but spawn new processes and return from CGI script immediately.
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)
  • /trunk/extensions/Collection/pdf-server/pdfserver.py (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.body.php
@@ -1183,6 +1183,7 @@
11841184 }
11851185 curl_setopt( $c, CURLOPT_HEADER, true );
11861186 curl_setopt( $c, CURLOPT_RETURNTRANSFER, true );
 1187+ curl_setopt( $c, CURLOPT_TIMEOUT, $wgHTTPTimeout );
11871188
11881189 $response = curl_exec( $c );
11891190
Index: trunk/extensions/Collection/pdf-server/pdfserver.py
@@ -157,7 +157,6 @@
158158
159159 args=[
160160 mwrender_cmd,
161 - '--daemonize',
162161 '--logfile', mwrender_logfile,
163162 '--error-file', self.get_path(collection_id, self.error_filename),
164163 '--status-file', self.get_path(collection_id, self.status_filename),
@@ -172,11 +171,9 @@
173172 args.extend(['--template-blacklist', template_blacklist])
174173
175174 try:
176 - rc = subprocess.call(executable=mwrender_cmd, args=args)
 175+ subprocess.Popen(executable=mwrender_cmd, args=args)
177176 except OSError, e:
178177 raise RuntimeError('Could not execute command %r: %s' % (mwrender_cmd, e))
179 - if rc != 0:
180 - return self.error_response('command %r failed: rc = %d' % (mwrender_cmd, rc))
181178
182179 return self.json_response({
183180 'collection_id': collection_id,
@@ -246,7 +243,6 @@
247244
248245 args = [
249246 mwzip_cmd,
250 - '--daemonize',
251247 '--logfile', mwzip_logfile,
252248 '--metabook', metabook_path,
253249 '--conf', base_url,
@@ -255,11 +251,9 @@
256252 if template_blacklist:
257253 args.extend(['--template-blacklist', template_blacklist])
258254 try:
259 - rc = subprocess.call(executable=mwzip_cmd, args=args)
 255+ subprocess.Popen(executable=mwzip_cmd, args=args)
260256 except OSError, e:
261257 raise RuntimeError('Could not execute command %r: %s' % (mwzip_cmd, e))
262 - if rc != 0:
263 - return self.error_response('command %r failed: rc = %d' % (mwzip_cmd, rc))
264258
265259 return self.json_response({'state': 'ok'})
266260

Status & tagging log