diff --git a/library/common/extensions/filters/http/platform_bridge/filter.cc b/library/common/extensions/filters/http/platform_bridge/filter.cc index 4aafebcb78..baea5572ad 100644 --- a/library/common/extensions/filters/http/platform_bridge/filter.cc +++ b/library/common/extensions/filters/http/platform_bridge/filter.cc @@ -167,28 +167,7 @@ void PlatformBridgeFilter::onDestroy() { ENVOY_LOG(trace, "PlatformBridgeFilter({})::onDestroy", filter_name_); alive_ = false; - auto& info = decoder_callbacks_->streamInfo(); - if (response_filter_base_->state_.stream_complete_ && platform_filter_.on_error && - StreamInfo::isStreamIdleTimeout(info)) { - // If the stream info has a response code details with a stream idle timeout, treat as error. - ENVOY_LOG(trace, "PlatformBridgeFilter({})->on_error", filter_name_); - envoy_data error_message = Data::Utility::copyToBridgeData("Stream idle timeout"); - auto& info = decoder_callbacks_->streamInfo(); - int32_t attempts = static_cast(info.attemptCount().value_or(0)); - - auto callback_time_ms = std::make_unique( - config_->stats().on_error_callback_latency_, timeSource()); - - platform_filter_.on_error({ENVOY_REQUEST_TIMEOUT, error_message, attempts}, streamIntel(), - finalStreamIntel(), platform_filter_.instance_context); - - callback_time_ms->complete(); - auto elapsed = callback_time_ms->elapsed(); - if (elapsed > SlowCallbackWarningThreshold) { - ENVOY_LOG_EVENT(warn, "slow_on_error_cb", - filter_name_ + "|" + std::to_string(elapsed.count()) + "ms"); - } - } else if (!response_filter_base_->state_.stream_complete_ && platform_filter_.on_cancel) { + if (!response_filter_base_->state_.stream_complete_ && platform_filter_.on_cancel) { // If the filter chain is destroyed before a response is received, treat as cancellation. ENVOY_LOG(trace, "PlatformBridgeFilter({})->on_cancel", filter_name_); diff --git a/test/swift/integration/IdleTimeoutTest.swift b/test/swift/integration/IdleTimeoutTest.swift index fd31bde902..d7d1d63841 100644 --- a/test/swift/integration/IdleTimeoutTest.swift +++ b/test/swift/integration/IdleTimeoutTest.swift @@ -81,13 +81,6 @@ static_resources: - endpoint: address: socket_address: { address: 127.0.0.1, port_value: \(remotePort) } -layered_runtime: - layers: - - name: static_layer_0 - static_layer: - envoy: - reloadable_features: - override_request_timeout_by_gateway_timeout: false """ class IdleTimeoutValidationFilter: AsyncResponseFilter, ResponseFilter { @@ -133,7 +126,7 @@ layered_runtime: } func onError(_ error: EnvoyError, streamIntel: FinalStreamIntel) { - XCTAssertEqual(error.errorCode, 4) + XCTAssertEqual(error.errorCode, 0) timeoutExpectation.fulfill() } @@ -166,7 +159,7 @@ layered_runtime: client .newStreamPrototype() .setOnError { error, _ in - XCTAssertEqual(error.errorCode, 4) + XCTAssertEqual(error.errorCode, 0) callbackExpectation.fulfill() } .setOnCancel { _ in