jenkins-bot has submitted this change and it was merged.

Change subject: Protect stream_get_contents() from hanging for sanity
......................................................................


Protect stream_get_contents() from hanging for sanity

Change-Id: Iac937c3f1a0e20e52a869bdc00dfad13b1c3c869
---
M redisJobRunnerService
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/redisJobRunnerService b/redisJobRunnerService
index eacf4ed..291c139 100755
--- a/redisJobRunnerService
+++ b/redisJobRunnerService
@@ -945,8 +945,13 @@
 
                // Start the runner in the background
                $procSlot['handle'] = proc_open( $cmd, $descriptors, 
$procSlot['pipes'] );
+               // Set a timeout so stream_get_contents() won't block for sanity
+               stream_set_timeout( $procSlot['pipes'][1], 5 );
+               stream_set_timeout( $procSlot['pipes'][2], 5 );
+               // Close the unused STDIN pipe
                fclose( $procSlot['pipes'][0] );
                unset( $procSlot['pipes'][0] ); // unused
+
                $procSlot['db'] = $db;
                $procSlot['type'] = $type;
                $procSlot['cmd'] = $cmd;

-- 
To view, visit https://gerrit.wikimedia.org/r/150279
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iac937c3f1a0e20e52a869bdc00dfad13b1c3c869
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/jobrunner
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to