Skip to content

Commit

Permalink
Update Envoy to c115749 (Feb 16, 2024) (#1083)
Browse files Browse the repository at this point in the history
- In `RemoteRequestSource`:
  - Adapt to gRPC client factory's starting to return a `StatusOr`: envoyproxy/envoy#32046
    - Rethrowing the error status as an exception will have the reasonable effect of exiting Nighthawk
  - Add detail to an existing cluster setup error message and change from `ASSERT` to `RELEASE_ASSERT`
- Updates from upstream in:
  - `.bazelversion`
  -  `tools/code_format/config.yaml`

Signed-off-by: eric846 <[email protected]>
  • Loading branch information
eric846 authored Feb 17, 2024
1 parent b9ce298 commit 680f1ed
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.2
6.5.0
4 changes: 2 additions & 2 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

ENVOY_COMMIT = "f84c5d119eedf80d726ddc6e3fb164df3dfb9e46"
ENVOY_SHA = "4393db0613875c26938f14527dc3f9f13a68807bba7be8b85b52c46f06c90ddf"
ENVOY_COMMIT = "c11574972860a40de36acf3ab8d930273f5ece65"
ENVOY_SHA = "a61e3e912d9b18034045ca347ac1f205cc2b878d6ea370f8c8e58ceb32b23f26"

HDR_HISTOGRAM_C_VERSION = "0.11.2" # October 12th, 2020
HDR_HISTOGRAM_C_SHA = "637f28b5f64de2e268131e4e34e6eef0b91cf5ff99167db447d9b2825eae6bad"
Expand Down
14 changes: 11 additions & 3 deletions source/common/request_source_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <chrono>

#include "envoy/common/exception.h"

#include "external/envoy/source/common/common/assert.h"

#include "source/common/request_impl.h"
Expand All @@ -10,6 +12,10 @@ namespace Nighthawk {

using namespace std::chrono_literals;

namespace {
using EnvoyException = Envoy::EnvoyException;
} // namespace

StaticRequestSourceImpl::StaticRequestSourceImpl(Envoy::Http::RequestHeaderMapPtr&& header,
const uint64_t max_yields)
: header_(std::move(header)), yields_left_(max_yields) {
Expand Down Expand Up @@ -38,15 +44,17 @@ void RemoteRequestSourceImpl::connectToRequestStreamGrpcService() {
const auto clusters = cluster_manager_->clusters();
const bool have_cluster =
clusters.active_clusters_.find(service_cluster_name_) != clusters.active_clusters_.end();
ASSERT(have_cluster);
RELEASE_ASSERT(have_cluster,
absl::StrCat("Failed to find service cluster ", service_cluster_name_));
const std::chrono::seconds STREAM_SETUP_TIMEOUT = 60s;
envoy::config::core::v3::GrpcService grpc_service;
grpc_service.mutable_envoy_grpc()->set_cluster_name(service_cluster_name_);
Envoy::Grpc::AsyncClientFactoryPtr cluster_manager =
absl::StatusOr<Envoy::Grpc::AsyncClientFactoryPtr> cluster_manager =
cluster_manager_->grpcAsyncClientManager().factoryForGrpcService(grpc_service, scope_,
/*skip_cluster_check=*/true);
THROW_IF_STATUS_NOT_OK(cluster_manager, throw);
grpc_client_ = std::make_unique<RequestStreamGrpcClientImpl>(
cluster_manager->createUncachedRawAsyncClient(), dispatcher_, *base_header_,
(*cluster_manager)->createUncachedRawAsyncClient(), dispatcher_, *base_header_,
header_buffer_length_);
grpc_client_->start();
const Envoy::MonotonicTime start = time_source.monotonicTime();
Expand Down
4 changes: 3 additions & 1 deletion tools/code_format/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ paths:
- source/common/protobuf/message_validator_impl.cc
- source/common/quic/quic_server_transport_socket_factory.cc
- source/common/secret/secret_manager_impl.cc
- source/common/grpc/async_client_manager_impl.cc
- source/common/grpc/google_grpc_utils.cc
- source/common/tcp_proxy/tcp_proxy.cc
- source/common/config/subscription_factory_impl.cc
Expand Down Expand Up @@ -170,6 +169,9 @@ paths:
- source/common/common/logger_delegates.cc
- source/common/upstream/health_checker_event_logger.h
- source/common/upstream/outlier_detection_impl.h
- source/common/ssl/certificate_validation_context_config_impl.cc
- source/common/grpc/google_grpc_creds_impl.cc
- source/common/local_reply/local_reply.cc

# Only one C++ file should instantiate grpc_init
grpc_init:
Expand Down

0 comments on commit 680f1ed

Please sign in to comment.