Problem reading from S3

Jun 7, 2011 at 9:05 PM

Hi everyone,

I have encountered a problem that the stream from AWSBlobSpec.Read() is always closed. I can still access the metadata though. I have checked out the source code and it seems that the stream is just being disposed:

using (var res = Container.Provider.S3Client.GetObject(req))
{
        Refresh(res);
        this.ContentLength = res.ContentLength;
        this.ContentType = res.ContentType;
        this.ETag = res.ETag;
        Found = true;
        return res.ResponseStream;
}

Thanks,
Artem.

 

Coordinator
Jun 7, 2011 at 9:40 PM

Hi,

i'll investigate this. The res.ResponseStream is probably Dispose()'d within the res.Dispose() ?

Jun 7, 2011 at 9:46 PM

Yes, I just found this in the source code of AWSSDK inside the GetObjectResponse.Dispose method:

if (responseStream != null)
{
        responseStream.Close();
        responseStream = null;
}

Coordinator
Jun 8, 2011 at 8:36 AM

I pushed a fix, but have not yet build a nuget package from that. If you are working from the sources, you can rebuild the dll