GCP pubsub.v1.Subscriber.StreamingPull中的错误代码503 [英] Error code 503 in GCP pubsub.v1.Subscriber.StreamingPull

查看:178
本文介绍了GCP pubsub.v1.Subscriber.StreamingPull中的错误代码503的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用发布/订阅服务,并且在仪表板中注意到以下错误代码.

I am trying to utilize pub/sub service and I noticed in my dashboard following error code.

这里链接是什么 代码503

有什么可以阻止我的事情吗?

Is there anything that allow me to prevent that?

-阿斯卡尔

推荐答案

).通常,人们可以说这些类型的错误往往是暂时的,并且没有办法避免它们,您可以按照一种重试策略(例如我将在短期内评论的策略)来解决它们.

As explained in the documentation link about Error Codes that you shared, the HTTP code 503 ("UNAVAILABLE") is returned when the Pub/Sub service was not able to process a request. In general, one could say that these types of errors tend to be transient, and there's no way to avoid them, you can just work around them following a retry strategy such as the one I will comment shortly.

Google Cloud Pub/Sub SLA 显示了保证的这项服务的正常运行时间.如您所见,考虑到您遵循建议的实施带指数补偿的重试策略的做法,这不是100%,因为可能会发生短暂错误,这不会严重影响您的服务.

The Google Cloud Pub/Sub SLA shows the guaranteed uptime for this service. As you can see, it is not 100%, as transient errors may happen, which should not disturb your service greatly, considering that you follow the recommended practice of implementing a retry strategy with exponential backoff.

此文档页面显示了指数补偿重试策略的示例实现. .此示例适用于Google Cloud Storage,但可以(并且应该)将其应用于任何其他类似服务.它包括以增加的退避重试失败的Pub/Sub请求,以增加请求成功的可能性.这是推荐的最佳实践,也是克服瞬态问题的推荐方法.

This documentation page shows an example implementation of an Exponential Backoff retry strategy. This example is for Google Cloud Storage, but it can (and should) be applied to any other similar service. It consists in retrying the failed Pub/Sub requests with an increasing backoff in order to increase the probability of a request being successful. This is a recommended best practice and the recommended approach to overcome transient issues.

这篇关于GCP pubsub.v1.Subscriber.StreamingPull中的错误代码503的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆