Giuseppe Lavagetto has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/267228

Change subject: Add support for float timeouts in socket streams
......................................................................

Add support for float timeouts in socket streams

Also, make a new release and temporarily disable adding bzip2
support (it's untested, and we need to fix the timeouts bug
immediately).

Bug: T125084
Change-Id: I79a189c7a25ca3bc2bc83b3d5141589bb58725d0
---
M debian/changelog
A debian/patches/D37821-allow-float-timeout-on-socket-connections.diff
M debian/patches/series
3 files changed, 80 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/hhvm 
refs/changes/28/267228/1

diff --git a/debian/changelog b/debian/changelog
index 0a2270a..da76123 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+hhvm (3.6.5+dfsg1-1+wm8) trusty-wikimedia; urgency=medium
+
+  * Fix broken support for float timeout in socket streaming
+
+ -- Giuseppe Lavagetto <[email protected]>  Fri, 29 Jan 2016 11:22:59 
+0100
+
+hhvm (3.6.5+dfsg1-1+wm7) trusty-wikimedia; urgency=medium
+
+  * Fix Regex in sql statistics code
+
+ -- Giuseppe Lavagetto <[email protected]>  Thu, 01 Oct 2015 12:49:26 
+0200
+
 hhvm (3.6.5+dfsg1-1+wm7) trusty-wikimedia; urgency=medium
 
   * Fix Regex in sql statistics code
diff --git 
a/debian/patches/D37821-allow-float-timeout-on-socket-connections.diff 
b/debian/patches/D37821-allow-float-timeout-on-socket-connections.diff
new file mode 100644
index 0000000..ccccfaa
--- /dev/null
+++ b/debian/patches/D37821-allow-float-timeout-on-socket-connections.diff
@@ -0,0 +1,66 @@
+Description: socket timeout support float.
+ float value is supported by php5
+ (http://php.net/manual/en/function.stream-socket-client.php)
+Author: Tang Hongbo <[email protected]>
+Reviewed-by: Giuseppe Lavagetto <[email protected]>
+Last-Update: 2016-01-29
+Origin: https://github.com/facebook/hhvm/pull/5222
+
+diff --git a/hphp/runtime/ext/sockets/ext_sockets.cpp 
b/hphp/runtime/ext/sockets/ext_sockets.cpp
+index 56da92b..7f18fcd 100644
+--- a/hphp/runtime/ext/sockets/ext_sockets.cpp
++++ b/hphp/runtime/ext/sockets/ext_sockets.cpp
+@@ -351,7 +351,7 @@ static SmartPtr<Socket> create_new_socket(
+ }
+ 
+ static int connect_with_timeout(int fd, struct sockaddr *sa_ptr,
+-                                size_t sa_size, int timeout,
++                                size_t sa_size, double timeout,
+                                 const HostURL &hosturl,
+                                 std::string &errstr, int &errnum) {
+   if (timeout <= 0) {
+@@ -402,7 +402,7 @@ static int connect_with_timeout(int fd, struct sockaddr 
*sa_ptr,
+   return retval;
+ }
+ 
+-static Variant new_socket_connect(const HostURL &hosturl, int timeout,
++static Variant new_socket_connect(const HostURL &hosturl, double timeout,
+                                   const SmartPtr<StreamContext>& streamctx,
+                                   Variant &errnum, Variant &errstr) {
+   int domain = AF_UNSPEC;
+diff --git a/hphp/test/slow/ext_socket/client_float_timeout_open_port.php 
b/hphp/test/slow/ext_socket/client_float_timeout_open_port.php
+new file mode 100644
+index 0000000..7650106
+--- /dev/null
++++ b/hphp/test/slow/ext_socket/client_float_timeout_open_port.php
+@@ -0,0 +1,22 @@
++<?php
++function random_free_port() {
++  for ($i = 0; $i < 100; $i++) {
++    $port = rand(50000, 65000);
++    if ($socket = @socket_create_listen($port)) {
++      socket_close($socket);
++      return $port;
++    }
++  }
++  return 0;
++}
++
++$port = random_free_port();
++$time = microtime(true);
++@stream_socket_client("tcp://172.0.0.1:$port", $errno, $errstr, 0.001);
++$elapsed = microtime(true) - $time;
++echo $errstr, "\n";
++if ($elapsed < 1) {
++  print "SUCCESS";
++} else {
++  print "FAILURE";
++}
+diff --git 
a/hphp/test/slow/ext_socket/client_float_timeout_open_port.php.expect 
b/hphp/test/slow/ext_socket/client_float_timeout_open_port.php.expect
+new file mode 100644
+index 0000000..176553d
+--- /dev/null
++++ b/hphp/test/slow/ext_socket/client_float_timeout_open_port.php.expect
+@@ -0,0 +1,2 @@
++Connection timed out
++SUCCESS
diff --git a/debian/patches/series b/debian/patches/series
index dc008b6..4ebdedc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -15,5 +15,6 @@
 D45165-unserialize_ex.patch
 D44265-filter_var_array.patch
 D37899-ext_reflection.patch
-D2486378-compress_bzip2.patch
+#D2486378-compress_bzip2.patch
+D37821-allow-float-timeout-on-socket-connections.diff
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I79a189c7a25ca3bc2bc83b3d5141589bb58725d0
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/hhvm
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Lavagetto <[email protected]>

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

Reply via email to