From 7a83a5567796b34117f09594b1c0d0c3a13a5a80 Mon Sep 17 00:00:00 2001 From: Jae Kim Date: Tue, 21 Feb 2017 17:27:02 -0800 Subject: [PATCH 1/2] If QuotaControl service is not available, return utils::Status::OK --- contrib/endpoints/src/api_manager/quota_control.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/endpoints/src/api_manager/quota_control.cc b/contrib/endpoints/src/api_manager/quota_control.cc index 29fdb3fae1e..fda28b0f5bb 100644 --- a/contrib/endpoints/src/api_manager/quota_control.cc +++ b/contrib/endpoints/src/api_manager/quota_control.cc @@ -46,7 +46,10 @@ void QuotaControl(std::shared_ptr context, TRACE(trace_span) << "Quota service control request returned with " << "status " << status.ToString(); - continuation(status); + // if the quota control service API is not available, then pass client + // requests + continuation((status.code() == Code::UNAVAILABLE) ? utils::Status::OK + : status); }); } From 6e7ade48fb5aeba6382ed51ee7bf7cc8b857421a Mon Sep 17 00:00:00 2001 From: Jae Kim Date: Tue, 21 Feb 2017 18:10:21 -0800 Subject: [PATCH 2/2] Updated comment --- contrib/endpoints/src/api_manager/quota_control.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/endpoints/src/api_manager/quota_control.cc b/contrib/endpoints/src/api_manager/quota_control.cc index fda28b0f5bb..8a5b65322d6 100644 --- a/contrib/endpoints/src/api_manager/quota_control.cc +++ b/contrib/endpoints/src/api_manager/quota_control.cc @@ -46,8 +46,8 @@ void QuotaControl(std::shared_ptr context, TRACE(trace_span) << "Quota service control request returned with " << "status " << status.ToString(); - // if the quota control service API is not available, then pass client - // requests + // quota control is using "failed open" policy. If the server is not + // available, allow the request to go. continuation((status.code() == Code::UNAVAILABLE) ? utils::Status::OK : status); });