Enforce time limit within AssembleUploadChunks.php.
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 7 Jan 2013 23:19:20 +0000 (15:19 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 7 Jan 2013 23:19:20 +0000 (15:19 -0800)
Change-Id: I8cfcb09da8e7e9020e6b5dfbc5e727522d01b7c1

includes/api/ApiUpload.php

index 377bfbf..cfa1683 100644 (file)
@@ -226,7 +226,9 @@ class ApiUpload extends ApiBase {
                                                        '--quiet'
                                                )
                                        ) . " < " . wfGetNull() . " > " . wfGetNull() . " 2>&1 &";
-                                       wfShellExec( $cmd, $retVal ); // start a process in the background
+                                       // Start a process in the background. Enforce the time limits via PHP
+                                       // since ulimit4.sh seems to often not work for this particular usage.
+                                       wfShellExec( $cmd, $retVal, array(), array( 'time' => 0, 'memory' => 0 ) );
                                        if ( $retVal == 0 ) {
                                                $result['result'] = 'Poll';
                                        } else {