Skip to content

Commit

Permalink
runtime: removing thrift_connection_draining
Browse files Browse the repository at this point in the history
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
  • Loading branch information
alyssawilk committed Jun 10, 2024
1 parent b3b2c1a commit 95ee48d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
7 changes: 5 additions & 2 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,13 @@ removed_config_or_runtime:
Removed ``envoy.reloadable_features.detect_and_raise_rst_tcp_connection`` runtime flag and legacy code paths.
- area: http
change: |
Removed ``envoy.reloadable_features.lowercase_scheme`` runtime flag and lagacy code paths.
Removed ``envoy.reloadable_features.lowercase_scheme`` runtime flag and legacy code paths.
- area: upstream
change: |
Removed ``envoy.reloadable_features.convert_legacy_lb_config`` runtime flag and lagacy code paths.
Removed ``envoy.reloadable_features.convert_legacy_lb_config`` runtime flag and legacy code paths.
- area: thrift
change: |
Removed ``envoy.reloadable_features.thrift_connection_draining`` runtime flag and legacy code paths.
- area: router
change: |
Removed ``envoy.reloadable_features.copy_response_code_to_downstream_stream_info`` runtime flag and legacy code paths.
Expand Down
1 change: 0 additions & 1 deletion source/common/runtime/runtime_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ RUNTIME_GUARD(envoy_reloadable_features_strict_duration_validation);
RUNTIME_GUARD(envoy_reloadable_features_tcp_tunneling_send_downstream_fin_on_upstream_trailers);
RUNTIME_GUARD(envoy_reloadable_features_test_feature_true);
RUNTIME_GUARD(envoy_reloadable_features_thrift_allow_negative_field_ids);
RUNTIME_GUARD(envoy_reloadable_features_thrift_connection_draining);
RUNTIME_GUARD(envoy_reloadable_features_udp_socket_apply_aggregated_read_limit);
RUNTIME_GUARD(envoy_reloadable_features_uhv_allow_malformed_url_encoding);
RUNTIME_GUARD(envoy_reloadable_features_upstream_allow_connect_with_2xx);
Expand Down
35 changes: 16 additions & 19 deletions source/extensions/filters/network/thrift_proxy/conn_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -344,23 +344,21 @@ FilterStatus ConnectionManager::ResponseDecoder::messageBegin(MessageMetadataSha
// that we can support the header in TTwitter protocol, which reads/adds response headers to
// metadata in messageBegin when reading the response from upstream. Therefore detecting a drain
// should happen here.
if (Runtime::runtimeFeatureEnabled("envoy.reloadable_features.thrift_connection_draining")) {
metadata_->setDraining(!metadata->responseHeaders().get(Headers::get().Drain).empty());
metadata->responseHeaders().remove(Headers::get().Drain);

// Check if this host itself is draining.
//
// Note: Similarly as above, the response is buffered until transportEnd. Therefore metadata
// should be set before the encodeFrame() call. It should be set at or after the messageBegin
// call so that the header is added after all upstream headers passed, due to messageBegin
// possibly not getting headers in transportBegin.
if (cm.drain_decision_.drainClose()) {
ENVOY_STREAM_LOG(debug, "propogate Drain header for drain close decision", parent_);
// TODO(rgs1): should the key value contain something useful (e.g.: minutes til drain is
// over)?
metadata->responseHeaders().addReferenceKey(Headers::get().Drain, "true");
cm.stats_.downstream_response_drain_close_.inc();
}
metadata_->setDraining(!metadata->responseHeaders().get(Headers::get().Drain).empty());
metadata->responseHeaders().remove(Headers::get().Drain);

// Check if this host itself is draining.
//
// Note: Similarly as above, the response is buffered until transportEnd. Therefore metadata
// should be set before the encodeFrame() call. It should be set at or after the messageBegin
// call so that the header is added after all upstream headers passed, due to messageBegin
// possibly not getting headers in transportBegin.
if (cm.drain_decision_.drainClose()) {
ENVOY_STREAM_LOG(debug, "propogate Drain header for drain close decision", parent_);
// TODO(rgs1): should the key value contain something useful (e.g.: minutes til drain is
// over)?
metadata->responseHeaders().addReferenceKey(Headers::get().Drain, "true");
cm.stats_.downstream_response_drain_close_.inc();
}

parent_.recordResponseAccessLog(metadata);
Expand Down Expand Up @@ -1046,8 +1044,7 @@ void ConnectionManager::ActiveRpc::sendLocalReply(const DirectResponse& response

onLocalReply(*localReplyMetadata_, end_stream);

if (end_stream &&
Runtime::runtimeFeatureEnabled("envoy.reloadable_features.thrift_connection_draining")) {
if (end_stream) {
localReplyMetadata_->responseHeaders().addReferenceKey(Headers::get().Drain, "true");
ConnectionManager& cm = parent_;
cm.stats_.downstream_response_drain_close_.inc();
Expand Down

0 comments on commit 95ee48d

Please sign in to comment.