Skip to content

chore(operations): Update Rusoto to 0.38.0 #1112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ miniodat
.idea/
checkpoints/*
*.iml
*.tmp
*.tmp
53 changes: 27 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ tracing-tower = { git = "https://github.com/tokio-rs/tracing" }
hotmic = "0.8"

# Aws
rusoto_core = "0.37.0"
rusoto_s3 = "0.37.0"
rusoto_logs = "0.37.0"
rusoto_cloudwatch = "0.37.0"
rusoto_kinesis = "0.37.0"
rusoto_credential = "0.16.0"
rusoto_core = "0.38.0"
rusoto_s3 = "0.38.0"
rusoto_logs = "0.38.0"
rusoto_cloudwatch = "0.38.0"
rusoto_kinesis = "0.38.0"
rusoto_credential = "0.17.0"

# Tower
tower = "0.1.1"
Expand Down
38 changes: 19 additions & 19 deletions src/sinks/aws_cloudwatch_logs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use bytes::Bytes;
use futures::{future, stream::iter_ok, sync::oneshot, Async, Future, Poll, Sink};
use rusoto_core::{
request::{BufferedHttpResponse, HttpClient},
Region,
Region, RusotoError,
};
use rusoto_credential::DefaultCredentialsProvider;
use rusoto_logs::{
Expand Down Expand Up @@ -119,10 +119,10 @@ pub struct RequestConfig {

#[derive(Debug)]
pub enum CloudwatchError {
Put(PutLogEventsError),
Describe(DescribeLogStreamsError),
CreateStream(CreateLogStreamError),
CreateGroup(CreateLogGroupError),
Put(RusotoError<PutLogEventsError>),
Describe(RusotoError<DescribeLogStreamsError>),
CreateStream(RusotoError<CreateLogStreamError>),
CreateGroup(RusotoError<CreateLogGroupError>),
NoStreamsFound,
ServiceDropped,
MakeService,
Expand Down Expand Up @@ -398,7 +398,7 @@ fn partition(
enum HealthcheckError {
#[snafu(display("DescribeLogStreams failed: {}", source))]
DescribeLogStreamsFailed {
source: rusoto_logs::DescribeLogGroupsError,
source: RusotoError<rusoto_logs::DescribeLogGroupsError>,
},
#[snafu(display("No log group found"))]
NoLogGroup,
Expand Down Expand Up @@ -476,17 +476,17 @@ impl RetryLogic for CloudwatchRetryLogic {
fn is_retriable_error(&self, error: &Self::Error) -> bool {
match error {
CloudwatchError::Put(err) => match err {
PutLogEventsError::ServiceUnavailable(error) => {
RusotoError::Service(PutLogEventsError::ServiceUnavailable(error)) => {
error!(message = "put logs service unavailable.", %error);
true
}

PutLogEventsError::HttpDispatch(error) => {
RusotoError::HttpDispatch(error) => {
error!(message = "put logs http dispatch.", %error);
true
}

PutLogEventsError::Unknown(res)
RusotoError::Unknown(res)
if res.status.is_server_error()
|| res.status == http::StatusCode::TOO_MANY_REQUESTS =>
{
Expand All @@ -502,12 +502,12 @@ impl RetryLogic for CloudwatchRetryLogic {
},

CloudwatchError::Describe(err) => match err {
DescribeLogStreamsError::ServiceUnavailable(error) => {
RusotoError::Service(DescribeLogStreamsError::ServiceUnavailable(error)) => {
error!(message = "describe streams service unavailable.", %error);
true
}

DescribeLogStreamsError::Unknown(res)
RusotoError::Unknown(res)
if res.status.is_server_error()
|| res.status == http::StatusCode::TOO_MANY_REQUESTS =>
{
Expand All @@ -519,7 +519,7 @@ impl RetryLogic for CloudwatchRetryLogic {
true
}

DescribeLogStreamsError::HttpDispatch(error) => {
RusotoError::HttpDispatch(error) => {
error!(message = "describe streams http dispatch.", %error);
true
}
Expand All @@ -528,12 +528,12 @@ impl RetryLogic for CloudwatchRetryLogic {
},

CloudwatchError::CreateStream(err) => match err {
CreateLogStreamError::ServiceUnavailable(error) => {
RusotoError::Service(CreateLogStreamError::ServiceUnavailable(error)) => {
error!(message = "create stream service unavailable.", %error);
true
}

CreateLogStreamError::Unknown(res)
RusotoError::Unknown(res)
if res.status.is_server_error()
|| res.status == http::StatusCode::TOO_MANY_REQUESTS =>
{
Expand All @@ -545,7 +545,7 @@ impl RetryLogic for CloudwatchRetryLogic {
true
}

CreateLogStreamError::HttpDispatch(error) => {
RusotoError::HttpDispatch(error) => {
error!(message = "create stream http dispatch.", %error);
true
}
Expand Down Expand Up @@ -579,14 +579,14 @@ impl fmt::Display for CloudwatchError {

impl std::error::Error for CloudwatchError {}

impl From<PutLogEventsError> for CloudwatchError {
fn from(e: PutLogEventsError) -> Self {
impl From<RusotoError<PutLogEventsError>> for CloudwatchError {
fn from(e: RusotoError<PutLogEventsError>) -> Self {
CloudwatchError::Put(e)
}
}

impl From<DescribeLogStreamsError> for CloudwatchError {
fn from(e: DescribeLogStreamsError) -> Self {
impl From<RusotoError<DescribeLogStreamsError>> for CloudwatchError {
fn from(e: RusotoError<DescribeLogStreamsError>) -> Self {
CloudwatchError::Describe(e)
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/sinks/aws_cloudwatch_logs/request.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::CloudwatchError;
use futures::{sync::oneshot, try_ready, Async, Future, Poll};
use rusoto_core::RusotoFuture;
use rusoto_core::{RusotoError, RusotoFuture};
use rusoto_logs::{
CloudWatchLogs, CloudWatchLogsClient, CreateLogGroupError, CreateLogGroupRequest,
CreateLogStreamError, CreateLogStreamRequest, DescribeLogStreamsError,
Expand Down Expand Up @@ -78,7 +78,10 @@ impl Future for CloudwatchFuture {
Ok(Async::Ready(res)) => res,
Ok(Async::NotReady) => return Ok(Async::NotReady),
Err(e) => {
if let DescribeLogStreamsError::ResourceNotFound(_) = e {
if let RusotoError::Service(
DescribeLogStreamsError::ResourceNotFound(_),
) = e
{
if self.create_missing_group {
info!("log group provided does not exist; creating a new one.");

Expand Down
12 changes: 6 additions & 6 deletions src/sinks/aws_cloudwatch_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use futures::{Future, Poll};
use rusoto_cloudwatch::{
CloudWatch, CloudWatchClient, Dimension, MetricDatum, PutMetricDataError, PutMetricDataInput,
};
use rusoto_core::{Region, RusotoFuture};
use rusoto_core::{Region, RusotoError, RusotoFuture};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::{convert::TryInto, time::Duration};
Expand Down Expand Up @@ -194,7 +194,7 @@ impl CloudWatchMetricsSvc {

impl Service<Vec<Metric>> for CloudWatchMetricsSvc {
type Response = ();
type Error = PutMetricDataError;
type Error = RusotoError<PutMetricDataError>;
type Future = RusotoFuture<(), PutMetricDataError>;

fn poll_ready(&mut self) -> Poll<(), Self::Error> {
Expand All @@ -217,14 +217,14 @@ impl Service<Vec<Metric>> for CloudWatchMetricsSvc {
struct CloudWatchMetricsRetryLogic;

impl RetryLogic for CloudWatchMetricsRetryLogic {
type Error = PutMetricDataError;
type Error = RusotoError<PutMetricDataError>;
type Response = ();

fn is_retriable_error(&self, error: &Self::Error) -> bool {
match error {
PutMetricDataError::HttpDispatch(_) => true,
PutMetricDataError::InternalServiceFault(_) => true,
PutMetricDataError::Unknown(res)
RusotoError::HttpDispatch(_) => true,
RusotoError::Service(PutMetricDataError::InternalServiceFault(_)) => true,
RusotoError::Unknown(res)
if res.status.is_server_error()
|| res.status == http::StatusCode::TOO_MANY_REQUESTS =>
{
Expand Down
14 changes: 7 additions & 7 deletions src/sinks/aws_kinesis_streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
};
use futures::{stream::iter_ok, Future, Poll, Sink};
use rand::random;
use rusoto_core::RusotoFuture;
use rusoto_core::{RusotoError, RusotoFuture};
use rusoto_kinesis::{
Kinesis, KinesisClient, ListStreamsInput, PutRecordsError, PutRecordsInput, PutRecordsOutput,
PutRecordsRequestEntry,
Expand Down Expand Up @@ -115,7 +115,7 @@ impl KinesisService {

impl Service<Vec<PutRecordsRequestEntry>> for KinesisService {
type Response = PutRecordsOutput;
type Error = PutRecordsError;
type Error = RusotoError<PutRecordsError>;
type Future = Instrumented<RusotoFuture<PutRecordsOutput, PutRecordsError>>;

fn poll_ready(&mut self) -> Poll<(), Self::Error> {
Expand Down Expand Up @@ -151,14 +151,14 @@ impl fmt::Debug for KinesisService {
struct KinesisRetryLogic;

impl RetryLogic for KinesisRetryLogic {
type Error = PutRecordsError;
type Error = RusotoError<PutRecordsError>;
type Response = PutRecordsOutput;

fn is_retriable_error(&self, error: &Self::Error) -> bool {
match error {
PutRecordsError::HttpDispatch(_) => true,
PutRecordsError::ProvisionedThroughputExceeded(_) => true,
PutRecordsError::Unknown(res) if res.status.is_server_error() => true,
RusotoError::HttpDispatch(_) => true,
RusotoError::Service(PutRecordsError::ProvisionedThroughputExceeded(_)) => true,
RusotoError::Unknown(res) if res.status.is_server_error() => true,
_ => false,
}
}
Expand All @@ -168,7 +168,7 @@ impl RetryLogic for KinesisRetryLogic {
enum HealthcheckError {
#[snafu(display("ListStreams failed: {}", source))]
ListStreamsFailed {
source: rusoto_kinesis::ListStreamsError,
source: RusotoError<rusoto_kinesis::ListStreamsError>,
},
#[snafu(display("Stream names do not match, got {}, expected {}", name, stream_name))]
StreamNamesMismatch { name: String, stream_name: String },
Expand Down
Loading