-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix(elasticsearch sink): Wrap provider call with a tokio runtime #1104
Conversation
This change fixes the usage of `rusoto`'s credentials the issue arises when a user wants to fetch credentials via the network with the `InstanceMetadataProvider` type. This type sets a timer that depends on the `tokio-timer` being set. Previously, this sink used the `wait` combinator that _does_ not wrap the future with a tokio timer. Thus, when a user tried to run this it would fail out because the timer was not set. This changes the code to allow the `credentials` fetch future to be wrapped in a tokio timer. Closes #1093 Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
Can you explain why this will close the linked issue? It seems like this will just allow a timeout to happen, not a previously failing call to succeed. |
@lukesteensen This closes the issue because when This type of issue with the missing timer is a very common one so its just the fact that we were using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to reproduce the error on an ec2 instance with an IAM role and once wrapping the future and using
Runtime::block_on
I was able to fetch the credentials.
Lead with this next time 😄
DefaultCredentialsProvider::new() | ||
.context(AWSCredentialsProviderFailed)? | ||
.credentials() | ||
.wait() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure we should just swap out wait()
for sync()
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not available with the https://docs.rs/rusoto_credential/0.41.1/rusoto_credential/trait.ProvideAwsCredentials.html trait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. Weird that they're not using RusotoFuture
. Carry on.
This change fixes the usage of
rusoto
's credentialsthe issue arises when a user wants to fetch credentials
via the network with the
InstanceMetadataProvider
type.This type sets a timer that depends on the
tokio-timer
being set. Previously, this sink used the
wait
combinatorthat does not wrap the future with a tokio timer. Thus,
when a user tried to run this it would fail out because
the timer was not set. This changes the code to allow
the
credentials
fetch future to be wrapped in a tokiotimer.
Closes #1093
Signed-off-by: Lucio Franco luciofranco14@gmail.com