-
Notifications
You must be signed in to change notification settings - Fork 61
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
FutureManager hangs indefinitely in the case of a bad file. #30
Comments
Hi @marcinx27, could you try running your example with logging at debug level for |
And I assume if you call I’m guessing the download does not fail immediately, as And here I’m assuming that |
@dwhjames yeah. If I called it directly and it threw the exception. But, if I do it like
and then later do an |
Also, I'm working on figuring out how to get debug level logging working for |
With regards to logging, take a look at the logback config in the scratch project: |
If you capture the exception with And after that blocking call completes, |
It's wrapped by And that block never finishes. The future returned by FutureTransfer.listenFor is never complete, so it can never hit the map to run anything on the object the future is wrapping. |
val d = transferManager.download("bucket", "key", new File("foobar"))
val e = d.waitForException()
val b = d.isDone()
val s = d.getState() What are the values of |
|
Oh. So, if I understand the Amazon code correctly, the If I'm understanding that correctly, then in
and then handle the failed state (a |
There is an intentional race in
Crucially, 2. is performed after 1. so that if the progress listener was attached after the transfer already finished (and thus the listener doesn’t receive any events) then the final status will still be caught with If In the execution that you are encountering, the transfer state is not in a done state at the point immediately after attaching the progress listener. But as it appears that the SDK fails to signal the failure progress event, the future will never complete. Note that the catch block that sets the failure state is in So, I’m somewhat at a loss about how to fix this on the side of aws-wrap. I think it might be worth filing a bug on the SDK, as it seems bad that failure events are not being propagated. |
@dwhjames right, right. That makes sense. I forgot that Since I need to be able to do the operation of getting an object to a file, not an array of bytes, it seems like the only work around I have now is to just extend the AWS-Wrap to include getObject(GetObjectRequest, File) |
Ah, I haven’t published since your PR #29. I can do that today, if you’d like? I think Also, if you just use the direct wrapping of aws-wrap/src/main/scala/s3/s3.scala Line 96 in 47ccd30
I think
So an alternative implementation of |
Um. Give me a few hours before you publish. I noticed that I didn't implement the getObject with a file, and I would like to have that in there just in case I get too frustrated with hacking around the TransferManager and want to use the standard implementation. I'll work on it now and push by like 2:30 EST. |
No rush, I won’t have access to a machine I can publish from until late today. |
I’m not sure if this crosses the icky line, but one solution for this problem is to cast the |
That might be a workable thing. I'll probably look into going that way in a little bit. For right now, I think I'm going to go with just straight |
This approach seems to work. See 087cbdf...4615ada |
@dwhjames that seems pretty reasonable. I dig it. I'm going to flesh out what I've got going on now with the S3Client first, but I'm absolutely going to look into the new |
@marcinx27 did you submit an issue to https://github.com/aws/aws-sdk-java/ ? I couldn’t see anything. I’m going to refine the |
@dwhjames I didn't. I was going to, got side tracked, and then kind of forgot about doing it. And definitely let me know when you've got that new |
Let me know when you do. I’d like to track it. |
Cast to internal type `AbstractTransfer` so that a low-level state change listener can be attached. In light of issue #30, this provides a more foolproof implementation of listening to transfer events. There is now a three-way race to complete the promise that signals the completion/termination of the transfer. This adds an integration test for s3, using the fakes3 ruby gem. closes #30
@marcinx27, I just closed this from #35 |
@dwhjames Cool, man. That's awesome. When I find a free second I want to go over the new release and check it out. I'm sure it's great. |
In the process of trying to do a
TransferManager download
, I found a bug with theFutureTransfer.listenFor
code. In the simple example ofwhere "foobar" is a file with permissions of
400
, instead of throwing aFileNotFoundException
with bad permissions, it just hangs indefinitely. No amount of mapping, or making use ofwaitForCompletion()
seemed to help, leading to the conclusion that the Future is never finishing. I looked a little into the source code and found that in thelistenFor
function, there are cases where the 'progressEvent' will never fire. In this case, since the progress hadn't changed because the File failed before the, and the transfer wasn't done, it just hung.The text was updated successfully, but these errors were encountered: