Google App Engine上的模块之间的间歇性URLFetch错误

时间:2014-04-22 13:15:47

标签: php google-app-engine urlfetch

我有一个付费的App Engine应用程序。

它有2个模块。默认值是PHP,并且有一个'数据'模块,用Python编写。

数据模块用于使用Python ndb库与数据存储进行交互。

我打电话给'数据'来自我的PHP模块的模块 - 大约每分钟20次。

大多数情况下,一切都很好,数据通过我的Python端点流入数据存储区。

有时(每10分钟一次)呼叫失败,导致数据丢失,此消息(敏感文本替换为' xxx'):

PHP Warning:  file_get_contents(http://data.xxx.appspot.com/create/http-state): failed to open stream: Fetch error in xxx.php on line 29

以下是违规文件的第29行:

return file_get_contents($str_endpoint, FALSE, $obj_context);

在这些故障点,目标模块的日志中没有条目。

任何人都可以对此有所了解吗?

由于

-

已添加代码:

   public static function httpPostArray($str_endpoint, $arr_data)
   {
      $arr_opts = [
         'http' => [
            'method' => 'POST',
            'header' => 'Content-type: application/x-www-form-urlencoded',
            'content' => http_build_query($arr_data)
         ]
      ];
      $obj_context = stream_context_create($arr_opts);
      return file_get_contents($str_endpoint, FALSE, $obj_context);
   }

0 个答案:

没有答案