2017-02-19 81 views
0

在过去的一年中,我正在使用C#编写的Azure中的服务将数据流式传输到BigQuery,并且最近开始获得越来越多的以下错误(大部分请求成功):GoogleApiException:Google.Apis.Requests.RequestError当流式传输到BigQuery时,后端错误[500]

消息:[GoogleApiException:Google.Apis.Requests.RequestError一个 发生内部错误,并请求无法完成。 [500] 错误[ 消息[发生内部错误,请求无法完成]位置[ - ]原因[InternalError该]域[全球]]]

这是我使用的代码在我的服务:

public async Task<TableDataInsertAllResponse> Update(List<TableDataInsertAllRequest.RowsData> rows, string tableSuffix) 
     { 
      var request = new TableDataInsertAllRequest {Rows = rows, TemplateSuffix = tableSuffix}; 
      var insertRequest = mBigqueryService.Tabledata.InsertAll(request, ProjectId, mDatasetId, mTableId); 

      return await insertRequest.ExecuteAsync(); 
     } 

回答

1

就像任何其他的云服务,BigQuery的不提供100%的正常运行时间SLA(实际99.9%的),所以它的情况并不少见遇到这样的瞬态错误。我们也经常在我们的应用程序中收到它们

您需要在您的应用程序中构建指数退避 - 重试逻辑来处理此类错误。这样做的一个好方法是使用队列将数据流式传输到BigQuery。这就是我们所做的,它对我们来说非常有效。

一些更多的信息:

  1. https://cloud.google.com/bigquery/troubleshooting-errors
  2. https://cloud.google.com/bigquery/loading-data-post-request#exp-backoff
  3. https://cloud.google.com/bigquery/streaming-data-into-bigquery
  4. https://cloud.google.com/bigquery/sla
+0

指数回退是不错的,但不是强制性的在这个特定的服务,因为它更多的是一个监控服务。这项服务已经有一年左右的时间了,我们在过去两个月里开始发现这些错误,并且数量在不断增加。 – orso

+0

您可以通过您的Google支持渠道提交一张票,但我很确定他们会给您相同类型的回复。他们告诉我们,当我们做到这一点。 –

+0

谢谢格雷厄姆!我会试一试。 – orso