id stringlengths 22 133 | text stringlengths 40 40.2k | arch stringclasses 1
value | syntax stringclasses 1
value | kind stringclasses 4
values | repo stringclasses 27
values | path stringlengths 5 116 | license stringclasses 6
values | commit stringlengths 40 40 | source_host stringclasses 1
value | category stringclasses 16
values | source_url stringlengths 85 196 | line_start int64 1 4.28k | line_end int64 4 4.31k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:26 | modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
read_after_attempt,
&FinalizerInterceptorContextRef<'_>,
expected
);
}
// #[tokio::test]
// #[traced_test]
// async fn test_read_after_attempt_error_causes_jump_to_modify_b... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 0c75242eb1a5ffaac25659e2419f1cbdff559d89 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0c75242eb1a5ffaac25659e2419f1cbdff559d89/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,001 | 1,060 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:27 | &runtime_plugins(),
StopPoint::None,
)
.await
.expect("success");
assert!(context.response().is_some());
// StopPoint::BeforeTransmit will exit right before sending the request, so there should be no response
let context = invoke_with_stop_point(
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 0c75242eb1a5ffaac25659e2419f1cbdff559d89 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0c75242eb1a5ffaac25659e2419f1cbdff559d89/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,041 | 1,100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:28 | self.inner
.modify_before_retry_loop_called
.store(true, Ordering::Relaxed);
Err("test error".into())
}
fn modify_before_completion(
&self,
_context: &mut FinalizerInterceptorContextMut<'_>,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 0c75242eb1a5ffaac25659e2419f1cbdff559d89 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0c75242eb1a5ffaac25659e2419f1cbdff559d89/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,081 | 1,140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:29 | let runtime_plugins = || {
RuntimePlugins::new()
.with_operation_plugin(TestOperationRuntimePlugin)
.with_operation_plugin(NoAuthRuntimePlugin::new())
.with_operation_plugin(TestInterceptorRuntimePlugin {
interceptor: interceptor.clone(),
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 0c75242eb1a5ffaac25659e2419f1cbdff559d89 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/0c75242eb1a5ffaac25659e2419f1cbdff559d89/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,121 | 1,155 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// TODO(msrvUpgrade): This can be removed once we upgrade the MSRV to Rust 1.69
#![allow(unknown_lints)]
use self::auth::orchestrate_auth;
use crate::client::orchestrator::endpoints::orchestrate_endpoin... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:2 | debug!("encountered orchestrator error; halting");
$ctx.fail($err.into());
return;
}};
}
macro_rules! halt_on_err {
([$ctx:ident] => $expr:expr) => {
match $expr {
Ok(ok) => ok,
Err(err) => halt!([$ctx] => err),
}
};
}
macro_rules! continue_on_err {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:3 | /// Stop the orchestrator before transmitting the request
BeforeTransmit,
}
#[tracing::instrument(skip_all, name = "invoke")]
pub async fn invoke_with_stop_point(
input: Input,
runtime_plugins: &RuntimePlugins,
stop_point: StopPoint,
) -> Result<InterceptorContext, SdkError<Error, HttpResponse>> {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:4 | interceptors: &mut Interceptors,
runtime_plugins: &RuntimePlugins,
) -> Result<(), BoxError> {
runtime_plugins.apply_client_configuration(cfg, interceptors.client_interceptors_mut())?;
continue_on_err!([ctx] => interceptors.client_read_before_execution(ctx, cfg));
runtime_plugins
.apply_operatio... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | .set_loaded_request_body(LoadedRequestBody::Loaded(loaded_body));
}
// Before transmit
ctx.enter_before_transmit_phase();
halt_on_err!([ctx] => interceptors.read_after_serialization(ctx, cfg));
halt_on_err!([ctx] => interceptors.modify_before_retry_loop(ctx, cfg));
let retry_strategy = cfg.ret... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | // first time, but will fail on subsequent iterations if the request body wasn't retryable.
if let RewindResult::Impossible = ctx.rewind(cfg) {
debug!("request cannot be retried since the request body cannot be cloned");
break;
}
// Track which attempt we're currently on.... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:7 | ShouldAttempt::No => {
debug!("a retry is either unnecessary or not possible, exiting attempt loop");
break;
}
ShouldAttempt::YesAfterDelay(delay) => {
let sleep_impl = halt_on_err!([ctx] => cfg.sleep_impl().ok_or(OrchestratorError::other(
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:8 | ctx.enter_transmit_phase();
let call_result = halt_on_err!([ctx] => {
let request = ctx.take_request().expect("set during serialization");
cfg.connection().call(request).await.map_err(|err| {
match err.downcast() {
Ok(connector_error) => OrchestratorError::connector(*conn... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
interceptors: &Interceptors,
) {
continue_on_err!([ctx] => interceptors.modify_before_attempt_completion(ctx, cfg));
continue_on_err!([ctx] => interceptors.read_after_attempt(ctx, cfg));
}
#[instrument(skip_all)]
async fn finally_op(
ctx: &mut Inte... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | };
use aws_smithy_runtime_api::client::orchestrator::{
DynConnection, DynEndpointResolver, DynResponseDeserializer, SharedRequestSerializer,
};
use aws_smithy_runtime_api::client::retries::DynRetryStrategy;
use aws_smithy_runtime_api::client::runtime_plugin::{RuntimePlugin, RuntimePlugins};
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:11 | cfg.set_retry_strategy(DynRetryStrategy::new(NeverRetryStrategy::new()));
cfg.set_endpoint_resolver(DynEndpointResolver::new(
StaticUriEndpointResolver::http_localhost(8080),
));
cfg.set_endpoint_resolver_params(StaticUriEndpointResolverParams::new().into());
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | #[derive(Debug)]
struct FailingInterceptorsClientRuntimePlugin;
impl RuntimePlugin for FailingInterceptorsClientRuntimePlugin {
fn interceptors(&self, interceptors: &mut InterceptorRegistrar) {
interceptors.register(SharedInterceptor::new(FailingInterceptorA)... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:13 | let expected = r#""ConstructionFailure(ConstructionFailure { source: InterceptorError { kind: ReadBeforeExecution, source: Some(\"FailingInterceptorC\") } })""#.to_string();
interceptor_error_handling_test!(
read_before_execution,
&BeforeSerializationInterceptorContextRef<'_>,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:14 | #[tokio::test]
#[traced_test]
async fn test_modify_before_retry_loop_error_handling() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeRetryLoop, source: Some(\"FailingInterceptorC\") }, connection: Unknown } ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:15 | &BeforeTransmitInterceptorContextRef<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_after_signing_error_handling() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ReadAft... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:16 | async fn test_read_after_transmit_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterTransmit, source: Some(\"FailingInterceptorC\") }, raw: Response { status: 200, version: HTTP/1.1, headers: {}, body: SdkBody { inner: Once(None), retryable: true } } }... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 601 | 660 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:17 | }
#[tokio::test]
#[traced_test]
async fn test_modify_before_attempt_completion_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeAttemptCompletion, source: Some(\"FailingInterceptorC\") }, raw: Response { status: 200, version: HTTP/1.1,... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 641 | 700 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:18 | read_after_execution,
&FinalizerInterceptorContextRef<'_>,
expected
);
}
macro_rules! interceptor_error_redirection_test {
($origin_interceptor:ident, $origin_ctx:ty, $destination_interceptor:ident, $destination_ctx:ty, $expected:expr) => {
#[derive(Debug)]
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 681 | 740 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:19 | interceptors.register(SharedInterceptor::new(DestinationInterceptor));
}
}
let input = TypeErasedBox::new(Box::new(()));
let runtime_plugins = RuntimePlugins::new()
.with_operation_plugin(TestOperationRuntimePlugin)
.with_operation_plu... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 721 | 780 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:20 | modify_before_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_before_serialization_error_causes_jump_to_modify_before_completion() {
let expected = r#""ConstructionFailure(ConstructionFailure { s... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 761 | 820 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:21 | &mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_before_attempt_error_causes_jump_to_modify_before_attempt_completion() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), s... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 801 | 860 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:22 | expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_after_signing_error_causes_jump_to_modify_before_attempt_completion() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeAttemptCom... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 841 | 900 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:23 | );
}
#[tokio::test]
#[traced_test]
async fn test_read_after_transmit_error_causes_jump_to_modify_before_attempt_completion() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeAttemptCompletion, source: Some(\"DestinationInterceptor\") }, raw: Respon... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 881 | 940 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:24 | expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_after_deserialization_error_causes_jump_to_modify_before_attempt_completion()
{
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeAttemptCompletion, source: Some(\"DestinationI... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 921 | 980 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:25 | let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterExecution, source: Some(\"DestinationInterceptor\") }, raw: Response { status: 200, version: HTTP/1.1, headers: {}, body: SdkBody { inner: Once(Some(b\"\")), retryable: true } } })""#.to_string();
interceptor_error_redire... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 961 | 1,020 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:26 | #[tokio::test]
async fn test_stop_points_error_handling() {
#[derive(Debug, Default)]
struct Inner {
modify_before_retry_loop_called: AtomicBool,
modify_before_completion_called: AtomicBool,
read_after_execution_called: AtomicBool,
}
#[derive(Clone... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,001 | 1,060 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:27 | ) -> Result<(), BoxError> {
self.inner
.read_after_execution_called
.store(true, Ordering::Relaxed);
Ok(())
}
}
#[derive(Debug)]
struct TestInterceptorRuntimePlugin {
interceptor: TestInterceptor,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3295543612dada803b8ced9d8bc26acd7a2bd274 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3295543612dada803b8ced9d8bc26acd7a2bd274/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,041 | 1,092 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// TODO(msrvUpgrade): This can be removed once we upgrade the MSRV to Rust 1.69
#![allow(unknown_lints)]
use self::auth::orchestrate_auth;
use crate::client::orchestrator::endpoints::orchestrate_endpoin... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:4 | interceptors: &mut Interceptors,
runtime_plugins: &RuntimePlugins,
) -> Result<(), BoxError> {
runtime_plugins.apply_client_configuration(cfg, interceptors.client_interceptors_mut())?;
continue_on_err!([ctx] => interceptors.client_read_before_execution(ctx, cfg));
runtime_plugins
.apply_operatio... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | .set_loaded_request_body(LoadedRequestBody::Loaded(loaded_body));
}
// Before transmit
ctx.enter_before_transmit_phase();
halt_on_err!([ctx] => interceptors.read_after_serialization(ctx, cfg));
halt_on_err!([ctx] => interceptors.modify_before_retry_loop(ctx, cfg));
let retry_strategy = cfg.ret... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | // Track which attempt we're currently on.
cfg.interceptor_state()
.store_put::<RequestAttempts>(i.into());
let attempt_timeout_config = cfg.maybe_timeout_config(TimeoutKind::OperationAttempt);
let maybe_timeout = async {
try_attempt(ctx, cfg, interceptors, stop_point).aw... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:7 | }
}
}
}
#[instrument(skip_all)]
async fn try_attempt(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
interceptors: &Interceptors,
stop_point: StopPoint,
) {
halt_on_err!([ctx] => interceptors.read_before_attempt(ctx, cfg));
halt_on_err!([ctx] => orchestrate_endpoint(ctx, cfg).ma... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:8 | ctx.set_response(call_result);
ctx.enter_before_deserialization_phase();
halt_on_err!([ctx] => interceptors.read_after_transmit(ctx, cfg));
halt_on_err!([ctx] => interceptors.modify_before_deserialization(ctx, cfg));
halt_on_err!([ctx] => interceptors.read_before_deserialization(ctx, cfg));
ctx.en... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | cfg: &mut ConfigBag,
interceptors: &Interceptors,
) {
continue_on_err!([ctx] => interceptors.modify_before_completion(ctx, cfg));
continue_on_err!([ctx] => interceptors.read_after_execution(ctx, cfg));
}
#[cfg(all(test, feature = "test-util", feature = "anonymous-auth"))]
mod tests {
use super::*;
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | fn new_request_serializer() -> CannedRequestSerializer {
CannedRequestSerializer::success(
Request::builder()
.body(SdkBody::empty())
.expect("request is valid"),
)
}
fn new_response_deserializer() -> CannedResponseDeserializer {
CannedRespons... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:11 | macro_rules! interceptor_error_handling_test {
($interceptor:ident, $ctx:ty, $expected:expr) => {
#[derive(Debug)]
struct FailingInterceptorA;
impl Interceptor for FailingInterceptorA {
fn $interceptor(&self, _ctx: $ctx, _cfg: &mut ConfigBag) -> Result<(), Box... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | impl RuntimePlugin for FailingInterceptorsOperationRuntimePlugin {
fn interceptors(&self, interceptors: &mut InterceptorRegistrar) {
interceptors.register(SharedInterceptor::new(FailingInterceptorB));
interceptors.register(SharedInterceptor::new(FailingInterceptor... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:13 | let expected = r#""ConstructionFailure(ConstructionFailure { source: InterceptorError { kind: ModifyBeforeSerialization, source: Some(\"FailingInterceptorC\") } })""#.to_string();
interceptor_error_handling_test!(
modify_before_serialization,
&mut BeforeSerializationInterceptorContextMut... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:14 | #[tokio::test]
#[traced_test]
async fn test_read_before_attempt_error_handling() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ReadBeforeAttempt, source: Some(\"FailingInterceptorC\") }, connection: Unknown } })""#.to_... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:15 | &BeforeTransmitInterceptorContextRef<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_transmit_error_handling() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: Mod... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:16 | async fn test_modify_before_deserialization_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeDeserialization, source: Some(\"FailingInterceptorC\") }, raw: Response { status: 200, version: HTTP/1.1, headers: {}, body: SdkBody { inner: Once(None), r... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 601 | 660 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:17 | }
#[tokio::test]
#[traced_test]
async fn test_read_after_attempt_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterAttempt, source: Some(\"FailingInterceptorC\") }, raw: Response { status: 200, version: HTTP/1.1, headers: {}, body: SdkBody... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 641 | 700 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:18 | fn $origin_interceptor(
&self,
_ctx: $origin_ctx,
_cfg: &mut ConfigBag,
) -> Result<(), BoxError> {
tracing::debug!("OriginInterceptor called!");
Err("OriginInterceptor".into())
}
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 681 | 740 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:19 | .expect_err("should error");
let actual = format!("{:?}", actual);
assert_eq!($expected, format!("{:?}", actual));
assert!(logs_contain("OriginInterceptor called!"));
assert!(logs_contain("DestinationInterceptor called!"));
};
}
#[tokio::test]
#[trac... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 721 | 780 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:20 | read_before_serialization,
&BeforeSerializationInterceptorContextRef<'_>,
modify_before_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_after_serialization_error_causes_jump_to_mo... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 761 | 820 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:21 | &BeforeTransmitInterceptorContextRef<'_>,
modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_signing_error_causes_jump_to_modify_before_attempt_completion() {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 801 | 860 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:22 | modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_transmit_error_causes_jump_to_modify_before_attempt_completion() {
let expected = r#""DispatchFailure(DispatchFailur... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 841 | 900 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:23 | &mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_deserialization_error_causes_jump_to_modify_before_attempt_completion(
) {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: M... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 881 | 940 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:24 | &AfterDeserializationInterceptorContextRef<'_>,
modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_attempt_completion_error_causes_jump_to_read_after_attempt() {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 921 | 980 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:25 | async fn test_stop_points() {
let runtime_plugins = || {
RuntimePlugins::new()
.with_operation_plugin(TestOperationRuntimePlugin)
.with_operation_plugin(AnonymousAuthRuntimePlugin::new())
};
// StopPoint::None should result in a response getting set s... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 961 | 1,020 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:26 | }
impl Interceptor for TestInterceptor {
fn modify_before_retry_loop(
&self,
_context: &mut BeforeTransmitInterceptorContextMut<'_>,
_cfg: &mut ConfigBag,
) -> Result<(), BoxError> {
self.inner
.modify_b... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,001 | 1,060 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:27 | }
impl RuntimePlugin for TestInterceptorRuntimePlugin {
fn interceptors(&self, interceptors: &mut InterceptorRegistrar) {
interceptors.register(SharedInterceptor::new(self.interceptor.clone()));
}
}
let interceptor = TestInterceptor::default();
le... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b66b835baddd64acfb07cfca37baebfceeb10253 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b66b835baddd64acfb07cfca37baebfceeb10253/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,041 | 1,081 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// TODO(msrvUpgrade): This can be removed once we upgrade the MSRV to Rust 1.69
#![allow(unknown_lints)]
use self::auth::orchestrate_auth;
use crate::client::orchestrator::endpoints::orchestrate_endpoin... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:2 | $ctx.fail($err.into());
return;
}};
}
macro_rules! halt_on_err {
([$ctx:ident] => $expr:expr) => {
match $expr {
Ok(ok) => ok,
Err(err) => halt!([$ctx] => err),
}
};
}
macro_rules! continue_on_err {
([$ctx:ident] => $expr:expr) => {
if let Err(er... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:3 | BeforeTransmit,
}
#[tracing::instrument(skip_all, name = "invoke")]
pub async fn invoke_with_stop_point(
input: Input,
runtime_plugins: &RuntimePlugins,
stop_point: StopPoint,
) -> Result<InterceptorContext, SdkError<Error, HttpResponse>> {
let mut cfg = ConfigBag::base();
let cfg = &mut cfg;
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:4 | runtime_plugins: &RuntimePlugins,
) -> Result<(), BoxError> {
runtime_plugins.apply_client_configuration(cfg, interceptors.client_interceptors_mut())?;
continue_on_err!([ctx] => interceptors.client_read_before_execution(ctx, cfg));
runtime_plugins
.apply_operation_configuration(cfg, interceptors.ope... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | }
// Before transmit
ctx.enter_before_transmit_phase();
halt_on_err!([ctx] => interceptors.read_after_serialization(ctx, cfg));
halt_on_err!([ctx] => interceptors.modify_before_retry_loop(ctx, cfg));
let retry_strategy = cfg.retry_strategy();
// If we got a retry strategy from the bag, ask it ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | cfg.interceptor_state()
.store_put::<RequestAttempts>(i.into());
let attempt_timeout_config = cfg.maybe_timeout_config(TimeoutKind::OperationAttempt);
let maybe_timeout = async {
try_attempt(ctx, cfg, interceptors, stop_point).await;
finally_attempt(ctx, cfg, intercep... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:7 | }
}
}
#[instrument(skip_all)]
async fn try_attempt(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
interceptors: &Interceptors,
stop_point: StopPoint,
) {
halt_on_err!([ctx] => interceptors.read_before_attempt(ctx, cfg));
halt_on_err!([ctx] => orchestrate_endpoint(ctx, cfg).map_err(Orch... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:8 | ctx.enter_before_deserialization_phase();
halt_on_err!([ctx] => interceptors.read_after_transmit(ctx, cfg));
halt_on_err!([ctx] => interceptors.modify_before_deserialization(ctx, cfg));
halt_on_err!([ctx] => interceptors.read_before_deserialization(ctx, cfg));
ctx.enter_deserialization_phase();
le... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | interceptors: &Interceptors,
) {
continue_on_err!([ctx] => interceptors.modify_before_completion(ctx, cfg));
continue_on_err!([ctx] => interceptors.read_after_execution(ctx, cfg));
}
#[cfg(all(test, feature = "test-util", feature = "anonymous-auth"))]
mod tests {
use super::*;
use crate::client::orches... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | fn new_request_serializer() -> CannedRequestSerializer {
CannedRequestSerializer::success(
Request::builder()
.body(SdkBody::empty())
.expect("request is valid"),
)
}
fn new_response_deserializer() -> CannedResponseDeserializer {
CannedRespons... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:11 | ($interceptor:ident, $ctx:ty, $expected:expr) => {
#[derive(Debug)]
struct FailingInterceptorA;
impl Interceptor for FailingInterceptorA {
fn $interceptor(&self, _ctx: $ctx, _cfg: &mut ConfigBag) -> Result<(), BoxError> {
tracing::debug!("FailingIn... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | impl RuntimePlugin for FailingInterceptorsOperationRuntimePlugin {
fn interceptors(&self, interceptors: &mut InterceptorRegistrar) {
interceptors.register(SharedInterceptor::new(FailingInterceptorB));
interceptors.register(SharedInterceptor::new(FailingInterceptor... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:13 | interceptor_error_handling_test!(
modify_before_serialization,
&mut BeforeSerializationInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_before_serialization_error_handling() {
let expected = r#""ConstructionFai... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:14 | #[tokio::test]
#[traced_test]
async fn test_read_before_attempt_error_handling() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ReadBeforeAttempt, source: Some(\"FailingInterceptorC\") }, connection: Unknown } })""#.to_... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:15 | expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_transmit_error_handling() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeTransmit, source: Some(\"FailingInterceptorC\... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:16 | let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeDeserialization, source: Some(\"FailingInterceptorC\") }, raw: Response { status: 200, version: HTTP/1.1, headers: {}, body: SdkBody { inner: Once(None), retryable: true } } })""#.to_string();
interceptor_error_handlin... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 601 | 660 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:17 | #[tokio::test]
#[traced_test]
async fn test_read_after_attempt_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterAttempt, source: Some(\"FailingInterceptorC\") }, raw: Response { status: 200, version: HTTP/1.1, headers: {}, body: SdkBody { inne... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 641 | 700 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:18 | &self,
_ctx: $origin_ctx,
_cfg: &mut ConfigBag,
) -> Result<(), BoxError> {
tracing::debug!("OriginInterceptor called!");
Err("OriginInterceptor".into())
}
}
#[derive(Debug)]
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 681 | 740 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:19 | let actual = format!("{:?}", actual);
assert_eq!($expected, format!("{:?}", actual));
assert!(logs_contain("OriginInterceptor called!"));
assert!(logs_contain("DestinationInterceptor called!"));
};
}
#[tokio::test]
#[traced_test]
async fn test_read_before_ex... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 721 | 780 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:20 | &BeforeSerializationInterceptorContextRef<'_>,
modify_before_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_after_serialization_error_causes_jump_to_modify_before_completion() {
let ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 761 | 820 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:21 | modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_signing_error_causes_jump_to_modify_before_attempt_completion() {
let expected = r#""DispatchFailure(DispatchFailure... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 801 | 860 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:22 | &mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_transmit_error_causes_jump_to_modify_before_attempt_completion() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None)... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 841 | 900 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:23 | expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_deserialization_error_causes_jump_to_modify_before_attempt_completion(
) {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeAttemptCompletion, source: Some(\"Destinat... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 881 | 940 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:24 | modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_attempt_completion_error_causes_jump_to_read_after_attempt() {
let expected = r#""ResponseError(ResponseError { sour... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 921 | 980 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:25 | let runtime_plugins = || {
RuntimePlugins::new()
.with_operation_plugin(TestOperationRuntimePlugin)
.with_operation_plugin(AnonymousAuthRuntimePlugin::new())
};
// StopPoint::None should result in a response getting set since orchestration doesn't stop
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 961 | 1,020 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:26 | impl Interceptor for TestInterceptor {
fn modify_before_retry_loop(
&self,
_context: &mut BeforeTransmitInterceptorContextMut<'_>,
_cfg: &mut ConfigBag,
) -> Result<(), BoxError> {
self.inner
.modify_before_retry... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,001 | 1,060 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:27 | impl RuntimePlugin for TestInterceptorRuntimePlugin {
fn interceptors(&self, interceptors: &mut InterceptorRegistrar) {
interceptors.register(SharedInterceptor::new(self.interceptor.clone()));
}
}
let interceptor = TestInterceptor::default();
let runtime_... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 253a15511a6a5f2940e1c914cc11de3a55235259 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/253a15511a6a5f2940e1c914cc11de3a55235259/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,041 | 1,080 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:1 | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// TODO(msrvUpgrade): This can be removed once we upgrade the MSRV to Rust 1.69
#![allow(unknown_lints)]
use self::auth::orchestrate_auth;
use crate::client::orchestrator::endpoints::orchestrate_endpoin... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | }
// Before transmit
ctx.enter_before_transmit_phase();
halt_on_err!([ctx] => interceptors.read_after_serialization(ctx, cfg));
halt_on_err!([ctx] => interceptors.modify_before_retry_loop(ctx, cfg));
let retry_strategy = cfg.retry_strategy();
// If we got a retry strategy from the bag, ask it ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | cfg.interceptor_state().put::<RequestAttempts>(i.into());
let attempt_timeout_config = cfg.maybe_timeout_config(TimeoutKind::OperationAttempt);
let maybe_timeout = async {
try_attempt(ctx, cfg, interceptors, stop_point).await;
finally_attempt(ctx, cfg, interceptors).await;
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:7 | }
}
#[instrument(skip_all)]
async fn try_attempt(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
interceptors: &Interceptors,
stop_point: StopPoint,
) {
halt_on_err!([ctx] => interceptors.read_before_attempt(ctx, cfg));
halt_on_err!([ctx] => orchestrate_endpoint(ctx, cfg).map_err(Orchestrat... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:8 | halt_on_err!([ctx] => interceptors.read_after_transmit(ctx, cfg));
halt_on_err!([ctx] => interceptors.modify_before_deserialization(ctx, cfg));
halt_on_err!([ctx] => interceptors.read_before_deserialization(ctx, cfg));
ctx.enter_deserialization_phase();
let output_or_error = async {
let respons... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | ) {
continue_on_err!([ctx] => interceptors.modify_before_completion(ctx, cfg));
continue_on_err!([ctx] => interceptors.read_after_execution(ctx, cfg));
}
#[cfg(all(test, feature = "test-util", feature = "anonymous-auth"))]
mod tests {
use super::*;
use crate::client::orchestrator::endpoints::{
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | )
}
fn new_response_deserializer() -> CannedResponseDeserializer {
CannedResponseDeserializer::new(
Response::builder()
.status(StatusCode::OK)
.body(SdkBody::empty())
.map_err(|err| OrchestratorError::other(Box::new(err)))
.ma... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:11 | #[derive(Debug)]
struct FailingInterceptorB;
impl Interceptor for FailingInterceptorB {
fn $interceptor(&self, _ctx: $ctx, _cfg: &mut ConfigBag) -> Result<(), BoxError> {
tracing::debug!("FailingInterceptorB called!");
Err("FailingIntercept... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | .with_client_plugin(FailingInterceptorsClientRuntimePlugin)
.with_operation_plugin(TestOperationRuntimePlugin)
.with_operation_plugin(AnonymousAuthRuntimePlugin::new())
.with_operation_plugin(FailingInterceptorsOperationRuntimePlugin);
let actual = invoke(inpu... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:13 | async fn test_read_before_serialization_error_handling() {
let expected = r#""ConstructionFailure(ConstructionFailure { source: InterceptorError { kind: ReadBeforeSerialization, source: Some(\"FailingInterceptorC\") } })""#.to_string();
interceptor_error_handling_test!(
read_before_serializa... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:14 | }
#[tokio::test]
#[traced_test]
async fn test_modify_before_signing_error_handling() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeSigning, source: Some(\"FailingInterceptorC\") }, connection: Unknown ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:15 | modify_before_transmit,
&mut BeforeTransmitInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_before_transmit_error_handling() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None)... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:16 | #[traced_test]
async fn test_read_before_deserialization_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ReadBeforeDeserialization, source: Some(\"FailingInterceptorC\") }, raw: Response { status: 200, version: HTTP/1.1, headers: {}, body: SdkBody { inner... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 601 | 660 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:17 | );
}
#[tokio::test]
#[traced_test]
async fn test_modify_before_completion_error_handling() {
let expected = r#""ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeCompletion, source: Some(\"FailingInterceptorC\") }, raw: Response { status: 200, version: HTTP/1.1, headers... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 641 | 700 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:18 | #[derive(Debug)]
struct DestinationInterceptor;
impl Interceptor for DestinationInterceptor {
fn $destination_interceptor(
&self,
_ctx: $destination_ctx,
_cfg: &mut ConfigBag,
) -> Result<(), BoxError> {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 681 | 740 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:19 | #[traced_test]
async fn test_read_before_execution_error_causes_jump_to_modify_before_completion() {
let expected = r#""ConstructionFailure(ConstructionFailure { source: InterceptorError { kind: ModifyBeforeCompletion, source: Some(\"DestinationInterceptor\") } })""#.to_string();
interceptor_error_r... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 721 | 780 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:20 | async fn test_read_after_serialization_error_causes_jump_to_modify_before_completion() {
let expected = r#""DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeCompletion, source: Some(\"DestinationInterceptor\") }, connection: Unknown } })"... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 7150a0800de9b7529f79521b351b8d7ea31fbfd0 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/7150a0800de9b7529f79521b351b8d7ea31fbfd0/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 761 | 820 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.