Skip to content
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

1117/s3 dl mtd future should fail when request fails #1122

Merged

Conversation

eyalfa
Copy link
Contributor

@eyalfa eyalfa commented Jul 21, 2018

fix issue #1117,
the future returned by S3Stream.download should fail when the underlying request to aws s3 fails (i.e. with a 404).

this PR first modified an existing test to check the future (in addition to the source) for failure, then it introduces a fix.

@eyalfa
Copy link
Contributor Author

eyalfa commented Jul 21, 2018

@2m, @jypma, @sfali, @lexn82 , @kag0 , you guys seem to have written most of the relevant code (@2m replied on the issue),
can you please have a look?

val source = Source
.fromFuture(future.flatMap(entityForSuccess).map(_._1))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see what's changing here. Aren't you just changing val future to include flatMap(entityForSuccess), rather than doing it in-line in the source declaration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jypma , this affects the error handling for the object metadata future as well, it will now fail on failed responses (i.e.404)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh I see. So the effect of the change is not here, but in the line 103 which maps future which now has error handling because of the added .flatMap(entityForSuccess).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly

@2m 2m merged commit 39d3925 into akka:master Jul 23, 2018
@2m 2m added this to the 0.21 milestone Jul 23, 2018
@2m 2m added the p:aws-s3 label Jul 23, 2018
@2m
Copy link
Member

2m commented Jul 23, 2018

Awesome. Thanks for the fix!

sebastianharko pushed a commit to sebastianharko/alpakka that referenced this pull request Sep 5, 2018
* 1117: fix the issue by extracting errors before looking at the returned headers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants