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:8 | }
// Save a request checkpoint before we make the request. This will allow us to "rewind"
// the request in the case of retry attempts.
ctx.save_checkpoint();
let mut retry_delay = None;
for i in 1u32.. {
// Break from the loop if we can't rewind the request's state. This will always succee... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | let should_attempt = halt_on_err!([ctx] => runtime_components
.retry_strategy()
.should_attempt_retry(ctx, runtime_components, cfg)
.map_err(OrchestratorError::other));
match should_attempt {
// Yes, let's retry the request
ShouldAttempt::Yes => contin... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | run_interceptors!(halt_on_err: {
read_after_signing(ctx, runtime_components, cfg);
modify_before_transmit(ctx, runtime_components, cfg);
read_before_transmit(ctx, runtime_components, cfg);
});
// Return early if a stop point is set for before transmit
if let StopPoint::BeforeTransmi... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:11 | ctx.enter_before_deserialization_phase();
run_interceptors!(halt_on_err: {
read_after_transmit(ctx, runtime_components, cfg);
modify_before_deserialization(ctx, runtime_components, cfg);
read_before_deserialization(ctx, runtime_components, cfg);
});
ctx.enter_deserialization_phase(... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | #[instrument(skip_all, level = "debug")]
async fn finally_attempt(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
runtime_components: &RuntimeComponents,
) {
run_interceptors!(continue_on_err: {
modify_before_attempt_completion(ctx, runtime_components, cfg);
read_after_attempt(ctx, r... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:13 | EndpointResolverParams, SharedEndpointResolver,
};
use aws_smithy_runtime_api::client::http::{
http_client_fn, HttpConnector, HttpConnectorFuture,
};
use aws_smithy_runtime_api::client::interceptors::context::{
AfterDeserializationInterceptorContextRef, BeforeDeserializationInterceptorCo... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:14 | .body(SdkBody::empty())
.map_err(|err| OrchestratorError::other(Box::new(err)))
.map(Output::erase),
)
}
#[derive(Debug, Default)]
struct OkConnector {}
impl OkConnector {
fn new() -> Self {
Self::default()
}
}
impl HttpConne... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:15 | OkConnector::new().into_shared()
})))
.with_auth_scheme_option_resolver(Some(SharedAuthSchemeOptionResolver::new(
StaticAuthSchemeOptionResolver::new(vec![NO_AUTH_SCHEME_ID]),
))),
}
}
}
impl RuntimePlugin f... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:16 | fn $interceptor(
&self,
_ctx: $ctx,
$($rc_arg)*
_cfg: &mut ConfigBag,
) -> Result<(), BoxError> {
tracing::debug!("FailingInterceptorA called!");
Err("FailingInterceptorA".into())
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 601 | 660 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:17 | Err("FailingInterceptorC".into())
}
}
#[derive(Debug)]
struct FailingInterceptorsClientRuntimePlugin(RuntimeComponentsBuilder);
impl FailingInterceptorsClientRuntimePlugin {
fn new() -> Self {
Self(RuntimeComponentsBuil... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 641 | 700 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:18 | let actual = invoke("test", "test", input, &runtime_plugins)
.await
.expect_err("should error");
let actual = format!("{:?}", actual);
assert!(
actual.starts_with(&$expected),
"\nActual error: {actual}\nShould start with: {}\n"... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 681 | 740 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:19 | async fn test_read_before_serialization_error_handling() {
let expected = r#"ConstructionFailure(ConstructionFailure { source: InterceptorError { kind: ReadBeforeSerialization, interceptor_name: Some("FailingInterceptorC"), source: Some("FailingInterceptorC") } })"#.to_string();
interceptor_error_handli... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 721 | 780 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:20 | }
#[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, interceptor_name: Some("FailingInterceptorC")"#;
inter... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/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_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 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 801 | 860 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:22 | #[traced_test]
async fn test_read_before_deserialization_error_handling() {
let expected = r#"ResponseError(ResponseError { source: InterceptorError { kind: ReadBeforeDeserialization, interceptor_name: Some("FailingInterceptorC")"#;
interceptor_error_handling_test!(
read_before_deseriali... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/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_modify_before_completion_error_handling() {
let expected = r#"ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeCompletion, interceptor_name: Some("FailingInterceptorC")"#;
interceptor_error_handling_test!(
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 881 | 940 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:24 | _ctx: $origin_ctx,
$($rc_arg)*
_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 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 921 | 980 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:25 | }
let input = Input::doesnt_matter();
let runtime_plugins = RuntimePlugins::new()
.with_operation_plugin(TestOperationRuntimePlugin::new())
.with_operation_plugin(NoAuthRuntimePlugin::new())
.with_operation_plugin(InterceptorsTestOperationRuntimeP... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 961 | 1,020 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:26 | modify_before_serialization,
&mut BeforeSerializationInterceptorContextMut<'_>,
modify_before_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_before_serialization_error_causes_jum... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/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 | &mut BeforeTransmitInterceptorContextMut<'_>,
modify_before_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_before_attempt_error_causes_jump_to_modify_before_attempt_completion() {
le... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/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 | modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_after_signing_error_causes_jump_to_modify_before_attempt_completion() {
let expected = r#"DispatchFailure(DispatchFailure { s... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/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 | &mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[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: ModifyBeforeAttem... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,121 | 1,180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:30 | modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_after_deserialization_error_causes_jump_to_modify_before_attempt_completion()
{
let expected = r#"ResponseError(ResponseE... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,161 | 1,220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:31 | read_after_execution,
&FinalizerInterceptorContextRef<'_>,
expected
);
}
#[tokio::test]
async fn test_stop_points() {
let runtime_plugins = || {
RuntimePlugins::new()
.with_operation_plugin(TestOperationRuntimePlugin::new())
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,201 | 1,260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:32 | #[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 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,241 | 1,300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:33 | }
fn read_after_execution(
&self,
_context: &FinalizerInterceptorContextRef<'_>,
_rc: &RuntimeComponents,
_cfg: &mut ConfigBag,
) -> Result<(), BoxError> {
self.inner
.read_after_execution_called... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,281 | 1,340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:34 | };
// StopPoint::BeforeTransmit will exit right before sending the request, so there should be no response
let _err = invoke_with_stop_point(
"test",
"test",
Input::doesnt_matter(),
&runtime_plugins(),
StopPoint::BeforeTransmit,
)
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 3b61e78010e79d30cc38661acebacc6ff89ed84a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/3b61e78010e79d30cc38661acebacc6ff89ed84a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,321 | 1,348 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | run_interceptors!(halt_on_err: {
read_after_signing(ctx, runtime_components, cfg);
modify_before_transmit(ctx, runtime_components, cfg);
read_before_transmit(ctx, runtime_components, cfg);
});
// Return early if a stop point is set for before transmit
if let StopPoint::BeforeTransmi... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 09c4ea416dfa98dd9596269a5f59fb0b8d58c954 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/09c4ea416dfa98dd9596269a5f59fb0b8d58c954/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | #[instrument(skip_all, level = "debug")]
async fn finally_attempt(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
runtime_components: &RuntimeComponents,
) {
run_interceptors!(continue_on_err: {
modify_before_attempt_completion(ctx, runtime_components, cfg);
read_after_attempt(ctx, r... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 09c4ea416dfa98dd9596269a5f59fb0b8d58c954 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/09c4ea416dfa98dd9596269a5f59fb0b8d58c954/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | finally_op(&mut ctx, cfg, &runtime_components).await;
if ctx.is_failed() {
Err(ctx.finalize().expect_err("it is failed"))
} else {
Ok(ctx)
}
}
.maybe_timeout(operation_timeout_config)
.await
}
// Include a random, intern... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b30f288c9f7dfdabd7bd6661ddeacf9f26a24871 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b30f288c9f7dfdabd7bd6661ddeacf9f26a24871/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | debug!(
"timeout settings for this operation: {:?}",
resolved_timeout_config
);
cfg.interceptor_state().store_put(resolved_timeout_config);
components.validate_final_config(cfg)?;
Ok(components)
}
#[instrument(skip_all, level = "debug")]
async fn try_op(
ctx: &mut InterceptorContex... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | b30f288c9f7dfdabd7bd6661ddeacf9f26a24871 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/b30f288c9f7dfdabd7bd6661ddeacf9f26a24871/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | finally_op(&mut ctx, cfg, &runtime_components).await;
if ctx.is_failed() {
Err(ctx.finalize().expect_err("it is failed"))
} else {
Ok(ctx)
}
}
.maybe_timeout(operation_timeout_config)
.await
}
// Include a random, intern... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | tracing::debug!(
"timeout settings for this operation: {:?}",
resolved_timeout_config
);
cfg.interceptor_state().store_put(resolved_timeout_config);
components.validate_final_config(cfg)?;
Ok(components)
}
#[instrument(skip_all, level = "debug")]
async fn try_op(
ctx: &mut Intercep... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | #[instrument(skip_all, level = "debug")]
async fn finally_attempt(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
runtime_components: &RuntimeComponents,
) {
run_interceptors!(continue_on_err: {
modify_before_attempt_completion(ctx, runtime_components, cfg);
read_after_attempt(ctx, r... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:13 | EndpointResolverParams, SharedEndpointResolver,
};
use aws_smithy_runtime_api::client::http::{
http_client_fn, HttpConnector, HttpConnectorFuture,
};
use aws_smithy_runtime_api::client::interceptors::context::{
AfterDeserializationInterceptorContextRef, BeforeDeserializationInterceptorCo... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:14 | impl OkConnector {
fn new() -> Self {
Self::default()
}
}
impl HttpConnector for OkConnector {
fn call(&self, _request: HttpRequest) -> HttpConnectorFuture {
HttpConnectorFuture::ready(Ok(::http::Response::builder()
.status(200)
.b... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:15 | impl RuntimePlugin for TestOperationRuntimePlugin {
fn config(&self) -> Option<FrozenLayer> {
let mut layer = Layer::new("TestOperationRuntimePlugin");
layer.store_put(AuthSchemeOptionResolverParams::new("idontcare"));
layer.store_put(EndpointResolverParams::new("dontcare"));... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:16 | Err("FailingInterceptorA".into())
}
}
#[derive(Debug)]
struct FailingInterceptorB;
impl Intercept for FailingInterceptorB {
fn name(&self) -> &'static str { "FailingInterceptorB" }
fn $interceptor(
&sel... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 601 | 660 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:17 | Self(RuntimeComponentsBuilder::new("test").with_interceptor(SharedInterceptor::new(FailingInterceptorA)))
}
}
impl RuntimePlugin for FailingInterceptorsClientRuntimePlugin {
fn runtime_components(&self, _: &RuntimeComponentsBuilder) -> Cow<'_, RuntimeComponentsBui... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 641 | 700 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:18 | );
assert!(logs_contain("FailingInterceptorA called!"));
assert!(logs_contain("FailingInterceptorB called!"));
assert!(logs_contain("FailingInterceptorC called!"));
};
}
#[tokio::test]
#[traced_test]
async fn test_read_before_execution_error_handling() {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 681 | 740 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:19 | #[tokio::test]
#[traced_test]
async fn test_read_after_serialization_error_handling() {
let expected = r#"DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ReadAfterSerialization, interceptor_name: Some("FailingInterceptorC")"#.to_string();
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 721 | 780 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:20 | &mut BeforeTransmitInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_before_signing_error_handling() {
let expected = r#"DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: Rea... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 761 | 820 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:21 | async fn test_read_before_transmit_error_handling() {
let expected = r#"DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ReadBeforeTransmit, interceptor_name: Some("FailingInterceptorC")"#;
interceptor_error_handling_test!(
read_b... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 801 | 860 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:22 | }
#[tokio::test]
#[traced_test]
async fn test_read_after_deserialization_error_handling() {
let expected = r#"ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterDeserialization, interceptor_name: Some("FailingInterceptorC")"#;
interceptor_error_handling_test!(
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 841 | 900 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:23 | modify_before_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_after_execution_error_handling() {
let expected = r#"ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterExecutio... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 881 | 940 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:24 | #[derive(Debug)]
struct DestinationInterceptor;
impl Intercept for DestinationInterceptor {
fn name(&self) -> &'static str { "DestinationInterceptor" }
fn $destination_interceptor(
&self,
_ctx: $destination_ctx,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 921 | 980 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:25 | .await
.expect_err("should error");
let actual = format!("{:?}", actual);
assert!(
actual.starts_with(&$expected),
"\nActual error: {actual}\nShould start with: {}\n",
$expected
);
assert!(logs_contain(... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/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]
#[traced_test]
async fn test_read_before_serialization_error_causes_jump_to_modify_before_completion() {
let expected = r#"ConstructionFailure(ConstructionFailure { source: InterceptorError { kind: ModifyBeforeCompletion, interceptor_name: Some("DestinationInterceptor")"#;
interce... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/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 | #[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), source: InterceptorError { kind: ModifyBeforeAttemptCompletion, interceptor_name: Some("DestinationInterc... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/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 | 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: ModifyBeforeAttemptCompletion, interceptor_name: Some("DestinationInterceptor")"#;
i... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/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 expected = r#"ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeAttemptCompletion, interceptor_name: Some("DestinationInterceptor")"#;
interceptor_error_redirection_test!(
read_after_transmit,
&BeforeDeserializationInterceptorContextRef<'_>,
modif... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,121 | 1,180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:30 | async fn test_read_after_deserialization_error_causes_jump_to_modify_before_attempt_completion()
{
let expected = r#"ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeAttemptCompletion, interceptor_name: Some("DestinationInterceptor")"#;
interceptor_error_redirection_test!(
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,161 | 1,220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:31 | let runtime_plugins = || {
RuntimePlugins::new()
.with_operation_plugin(TestOperationRuntimePlugin::new())
.with_operation_plugin(NoAuthRuntimePlugin::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 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,201 | 1,260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:32 | #[derive(Clone, Debug, Default)]
struct TestInterceptor {
inner: Arc<Inner>,
}
impl Intercept for TestInterceptor {
fn name(&self) -> &'static str {
"TestInterceptor"
}
fn modify_before_retry_loop(
&self,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,241 | 1,300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:33 | self.inner
.read_after_execution_called
.store(true, Ordering::Relaxed);
Ok(())
}
}
#[derive(Debug)]
struct TestInterceptorRuntimePlugin {
builder: RuntimeComponentsBuilder,
}
impl RuntimePlugin for... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,281 | 1,340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:34 | StopPoint::BeforeTransmit,
)
.await
.expect_err("an error was returned");
assert_eq!(client.num_calls(), 0);
assert!(interceptor
.inner
.modify_before_retry_loop_called
.load(Ordering::Relaxed));
assert!(interceptor
.inner
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 9b8ca78798f81c9c584f370062b401431e614ef9 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/9b8ca78798f81c9c584f370062b401431e614ef9/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,321 | 1,340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:4 | pub enum StopPoint {
/// Don't stop orchestration early
None,
/// Stop the orchestrator before transmitting the request
BeforeTransmit,
}
/// Same as [`invoke`], but allows for returning early at different points during orchestration.
///
/// Orchestration will cease at the point specified by `stop_po... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | finally_op(&mut ctx, cfg, &runtime_components).await;
if ctx.is_failed() {
Err(ctx.finalize().expect_err("it is failed"))
} else {
Ok(ctx)
}
}
.maybe_timeout(operation_timeout_config)
.await
}
.instrument(debug_span!("in... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 161 | 220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:6 | "timeout settings for this operation: {:?}",
resolved_timeout_config
);
cfg.interceptor_state().store_put(resolved_timeout_config);
components.validate_final_config(cfg)?;
Ok(components)
}
#[instrument(skip_all, level = "debug")]
async fn try_op(
ctx: &mut InterceptorContext,
cfg: &mut... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:7 | let loaded_body = halt_on_err!([ctx] =>
ByteStream::new(body).collect().await.map_err(OrchestratorError::other)
)
.into_bytes();
*ctx.request_mut().as_mut().expect("set above").body_mut() =
SdkBody::from(loaded_body.clone());
cfg.interceptor_state()
.s... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:8 | // Save a request checkpoint before we make the request. This will allow us to "rewind"
// the request in the case of retry attempts.
ctx.save_checkpoint();
let mut retry_delay = None;
for i in 1u32.. {
// Break from the loop if we can't rewind the request's state. This will always succeed the
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | .retry_strategy()
.should_attempt_retry(ctx, runtime_components, cfg)
.map_err(OrchestratorError::other));
match should_attempt {
// Yes, let's retry the request
ShouldAttempt::Yes => continue,
// No, this request shouldn't be retried
Shoul... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | run_interceptors!(halt_on_err: {
read_after_signing(ctx, runtime_components, cfg);
modify_before_transmit(ctx, runtime_components, cfg);
read_before_transmit(ctx, runtime_components, cfg);
});
// Return early if a stop point is set for before transmit
if let StopPoint::BeforeTransmi... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:11 | run_interceptors!(halt_on_err: {
read_after_transmit(ctx, runtime_components, cfg);
modify_before_deserialization(ctx, runtime_components, cfg);
read_before_deserialization(ctx, runtime_components, cfg);
});
ctx.enter_deserialization_phase();
let output_or_error = async {
le... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | async fn finally_attempt(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
runtime_components: &RuntimeComponents,
) {
run_interceptors!(continue_on_err: {
modify_before_attempt_completion(ctx, runtime_components, cfg);
read_after_attempt(ctx, runtime_components, cfg);
});
}
#[ins... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:13 | };
use aws_smithy_runtime_api::client::http::{
http_client_fn, HttpConnector, HttpConnectorFuture,
};
use aws_smithy_runtime_api::client::interceptors::context::{
AfterDeserializationInterceptorContextRef, BeforeDeserializationInterceptorContextMut,
BeforeDeserializationInterceptorCo... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 481 | 540 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:14 | impl OkConnector {
fn new() -> Self {
Self::default()
}
}
impl HttpConnector for OkConnector {
fn call(&self, _request: HttpRequest) -> HttpConnectorFuture {
HttpConnectorFuture::ready(Ok(::http::Response::builder()
.status(200)
.b... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 521 | 580 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:15 | impl RuntimePlugin for TestOperationRuntimePlugin {
fn config(&self) -> Option<FrozenLayer> {
let mut layer = Layer::new("TestOperationRuntimePlugin");
layer.store_put(AuthSchemeOptionResolverParams::new("idontcare"));
layer.store_put(EndpointResolverParams::new("dontcare"));... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 561 | 620 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:16 | }
}
#[derive(Debug)]
struct FailingInterceptorB;
impl Intercept for FailingInterceptorB {
fn name(&self) -> &'static str { "FailingInterceptorB" }
fn $interceptor(
&self,
_ctx: $ctx,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 601 | 660 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:17 | }
}
impl RuntimePlugin for FailingInterceptorsClientRuntimePlugin {
fn runtime_components(&self, _: &RuntimeComponentsBuilder) -> Cow<'_, RuntimeComponentsBuilder> {
Cow::Borrowed(&self.0)
}
}
#[derive(Debug)]
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 641 | 700 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:18 | assert!(logs_contain("FailingInterceptorA called!"));
assert!(logs_contain("FailingInterceptorB called!"));
assert!(logs_contain("FailingInterceptorC called!"));
};
}
#[tokio::test]
#[traced_test]
async fn test_read_before_execution_error_handling() {
let expecte... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 681 | 740 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:19 | #[tokio::test]
#[traced_test]
async fn test_read_after_serialization_error_handling() {
let expected = r#"DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ReadAfterSerialization, interceptor_name: Some("FailingInterceptorC")"#.to_string();
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 721 | 780 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:20 | expected
);
}
#[tokio::test]
#[traced_test]
async fn test_read_before_signing_error_handling() {
let expected = r#"DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ReadBeforeSigning, interceptor_name: Some("FailingInterceptor... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 761 | 820 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:21 | let expected = r#"DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ReadBeforeTransmit, interceptor_name: Some("FailingInterceptorC")"#;
interceptor_error_handling_test!(
read_before_transmit,
&BeforeTransmitInterceptorContextR... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 801 | 860 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:22 | #[tokio::test]
#[traced_test]
async fn test_read_after_deserialization_error_handling() {
let expected = r#"ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterDeserialization, interceptor_name: Some("FailingInterceptorC")"#;
interceptor_error_handling_test!(
read... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/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_read_after_execution_error_handling() {
let expected = r#"ResponseError(ResponseError { source: InterceptorError { kind: ReadAfterExecution, interceptor_name: Some("FailingInte... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 881 | 940 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:24 | #[derive(Debug)]
struct DestinationInterceptor;
impl Intercept for DestinationInterceptor {
fn name(&self) -> &'static str { "DestinationInterceptor" }
fn $destination_interceptor(
&self,
_ctx: $destination_ctx,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 921 | 980 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:25 | .expect_err("should error");
let actual = format!("{:?}", actual);
assert!(
actual.starts_with(&$expected),
"\nActual error: {actual}\nShould start with: {}\n",
$expected
);
assert!(logs_contain("OriginInterceptor call... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 961 | 1,020 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:26 | #[traced_test]
async fn test_read_before_serialization_error_causes_jump_to_modify_before_completion() {
let expected = r#"ConstructionFailure(ConstructionFailure { source: InterceptorError { kind: ModifyBeforeCompletion, interceptor_name: Some("DestinationInterceptor")"#;
interceptor_error_redirect... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/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 | async fn test_read_before_attempt_error_causes_jump_to_modify_before_attempt_completion() {
let expected = r#"DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeAttemptCompletion, interceptor_name: Some("DestinationInterceptor")"#;
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/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 | let expected = r#"DispatchFailure(DispatchFailure { source: ConnectorError { kind: Other(None), source: InterceptorError { kind: ModifyBeforeAttemptCompletion, interceptor_name: Some("DestinationInterceptor")"#;
interceptor_error_redirection_test!(
read_after_signing,
&BeforeTransmitInte... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/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 | interceptor_error_redirection_test!(
read_after_transmit,
&BeforeDeserializationInterceptorContextRef<'_>,
modify_before_attempt_completion,
&mut FinalizerInterceptorContextMut<'_>,
expected
);
}
#[tokio::test]
#[traced_test]
async fn ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,121 | 1,180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:30 | {
let expected = r#"ResponseError(ResponseError { source: InterceptorError { kind: ModifyBeforeAttemptCompletion, interceptor_name: Some("DestinationInterceptor")"#;
interceptor_error_redirection_test!(
read_after_deserialization,
&AfterDeserializationInterceptorContextRef<'_>,
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,161 | 1,220 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:31 | RuntimePlugins::new()
.with_operation_plugin(TestOperationRuntimePlugin::new())
.with_operation_plugin(NoAuthRuntimePlugin::new())
};
// StopPoint::None should result in a response getting set since orchestration doesn't stop
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 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,201 | 1,260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:32 | struct TestInterceptor {
inner: Arc<Inner>,
}
impl Intercept for TestInterceptor {
fn name(&self) -> &'static str {
"TestInterceptor"
}
fn modify_before_retry_loop(
&self,
_context: &mut BeforeTransmitInter... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,241 | 1,300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:33 | .read_after_execution_called
.store(true, Ordering::Relaxed);
Ok(())
}
}
#[derive(Debug)]
struct TestInterceptorRuntimePlugin {
builder: RuntimeComponentsBuilder,
}
impl RuntimePlugin for TestInterceptorRuntimePlugin {... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,281 | 1,339 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:34 | )
.await
.expect_err("an error was returned");
assert_eq!(client.num_calls(), 0);
assert!(interceptor
.inner
.modify_before_retry_loop_called
.load(Ordering::Relaxed));
assert!(interceptor
.inner
.modify_before_completi... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 300a69d40c69807d10991e51d664b23a72a6cc2a | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/300a69d40c69807d10991e51d664b23a72a6cc2a/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1,321 | 1,339 |
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
*/
use self::auth::orchestrate_auth;
use crate::client::interceptors::Interceptors;
use crate::client::orchestrator::endpoints::orchestrate_endpoint;
use crate::client::orchestrator::http::{log_response_bod... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 1 | 60 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:2 | /// Utility for making one-off unmodeled requests with the orchestrator.
pub mod operation;
macro_rules! halt {
([$ctx:ident] => $err:expr) => {{
debug!("encountered orchestrator error; halting");
$ctx.fail($err.into());
return;
}};
}
macro_rules! halt_on_err {
([$ctx:ident] => $ex... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 41 | 100 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:3 | (halt_on_err: $interceptor:ident($ctx:ident, $rc:ident, $cfg:ident)) => {
halt_on_err!([$ctx] => run_interceptors!(__private $interceptor($ctx, $rc, $cfg)))
};
(__private $interceptor:ident($ctx:ident, $rc:ident, $cfg:ident)) => {
Interceptors::new($rc.interceptors()).$interceptor($ctx, $rc, $cf... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 81 | 140 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:4 | /// Stop the orchestrator before transmitting the request
BeforeTransmit,
}
/// Same as [`invoke`], but allows for returning early at different points during orchestration.
///
/// Orchestration will cease at the point specified by `stop_point`. This is useful for orchestrations
/// that don't need to actually tra... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 121 | 180 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:5 | } else {
Ok(ctx)
}
}
.maybe_timeout(operation_timeout_config)
.await
}
.instrument(debug_span!("invoke", service = %service_name, operation = %operation_name))
.await
}
/// Apply configuration is responsible for apply runtime plugins to the config bag, as... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/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(resolved_timeout_config);
components.validate_final_config(cfg)?;
Ok(components)
}
#[instrument(skip_all, level = "debug")]
async fn try_op(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
runtime_components: &RuntimeComponents,
stop_point: StopPoint,
) {
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 201 | 260 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:7 | .into_bytes();
*ctx.request_mut().as_mut().expect("set above").body_mut() =
SdkBody::from(loaded_body.clone());
cfg.interceptor_state()
.store_put(LoadedRequestBody::Loaded(loaded_body));
}
// Before transmit
ctx.enter_before_transmit_phase();
run_interceptors!(h... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 241 | 300 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:8 | ctx.save_checkpoint();
let mut retry_delay = None;
for i in 1u32.. {
// Break from the loop if we can't rewind the request's state. This will always succeed the
// first time, but will fail on subsequent iterations if the request body wasn't retryable.
trace!("checking if context can be ... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 281 | 340 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:9 | match should_attempt {
// Yes, let's retry the request
ShouldAttempt::Yes => continue,
// No, this request shouldn't be retried
ShouldAttempt::No => {
debug!("a retry is either unnecessary or not possible, exiting attempt loop");
break;
... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 321 | 380 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:10 | read_before_transmit(ctx, runtime_components, cfg);
});
// Return early if a stop point is set for before transmit
if let StopPoint::BeforeTransmit = stop_point {
debug!("ending orchestration early because the stop point is `BeforeTransmit`");
return;
}
// The connection consumes t... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 361 | 420 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:11 | let output_or_error = async {
let response = ctx.response_mut().expect("set during transmit");
let response_deserializer = cfg
.load::<SharedResponseDeserializer>()
.expect("a request deserializer must be in the config bag");
let maybe_deserialized = {
let _sp... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 401 | 460 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:12 | });
}
#[instrument(skip_all, level = "debug")]
async fn finally_op(
ctx: &mut InterceptorContext,
cfg: &mut ConfigBag,
runtime_components: &RuntimeComponents,
) {
run_interceptors!(continue_on_err: {
modify_before_completion(ctx, runtime_components, cfg);
read_after_execution(ctx, runti... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 441 | 500 |
awslabs/aws-sdk-rust:sdk/aws-smithy-runtime/src/client/orchestrator.rs:13 | BeforeTransmitInterceptorContextRef, FinalizerInterceptorContextMut,
FinalizerInterceptorContextRef,
};
use aws_smithy_runtime_api::client::interceptors::{Intercept, SharedInterceptor};
use aws_smithy_runtime_api::client::orchestrator::HttpRequest;
use aws_smithy_runtime_api::client::retries::Sh... | rust | rust | macro-heavy | awslabs/aws-sdk-rust | sdk/aws-smithy-runtime/src/client/orchestrator.rs | Apache-2.0 | 02aa74d2aac3b5cc8dfdd9437bd29983ca385851 | github | sdk | https://github.com/awslabs/aws-sdk-rust/blob/02aa74d2aac3b5cc8dfdd9437bd29983ca385851/sdk/aws-smithy-runtime/src/client/orchestrator.rs | 481 | 540 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.