pili-engineering / pili-sdk-php

Pili Streaming Cloud server-side library for PHP
MIT License
73 stars 31 forks source link

Pili的接口是不是没设置curl的访问超时? #46

Open spgyip opened 8 years ago

spgyip commented 8 years ago

问题描述

我们的php-fpm最近偶发性被挂死,定位到是Pili Sdk里面的curl socket阻塞。

相关代码

Pili/Transport.php :

public function send($method, $url, $body = NULL)
{
          $headers = $this->_setHeaders($method, $url, $body);
          $response = HttpRequest::send($method, $url, $body, $headers);
          return $response->body;
}

建议

增加超时设置

HttpRequest::timeout(3);
longbai commented 8 years ago

好的,我们处理下