You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Ignasi Barrera <na...@apache.org> on 2014/05/23 15:49:43 UTC

JENKINS-23049

Hi!

I've just seen JENKINS-23049 [1], and I recall some changes in jclouds
to fix this. Don't remember who did the fix, but it would be nice of
someone could have a look, or just point me in the right direction to
fix it :)

Thx!

I.

[1] https://issues.jenkins-ci.org/browse/JENKINS-23049

Re: JENKINS-23049

Posted by Andrew Gaul <ga...@apache.org>.
On Fri, May 23, 2014 at 06:28:58PM +0200, Andrew Phillips wrote:
> >I've just seen JENKINS-23049 [1], and I recall some changes in jclouds
> >to fix this.
> 
> By the looks of it, this behaviour would be expected? Trying to
> upload a blob with a payload but no content length seems to be
> supposed to fail [1]. See JCLOUDS-508 [2] for a related comment, and
> an answer from Gaul to a Stack Overflow question [3].
> 
> The only vaguely recent (over a year ago ;-)) change I can think of
> relating to content length is [4], but that's at a really low level.

Agree with your assessment.  JENKINS-23049 does not have enough context
to determine whether this is a regression or not; I suspect that someone
addressed a deprecation warning within Jenkins, changing a
ByteArrayPayload to a ByteSourcePayload.  The former gives an implicit
content length while the latter does not, yielding the symptoms
described.

Unfortunately we cannot implicitly populate length efficiently for all
ByteSource implementations.  We could do something similar to the first
half of ByteSource.size, calling countBySkipping.  Or we could recommend
use of new Payloads.newPayload wrappers which populate length for byte[]
and File parameters.  I am not yet convinced that we need a solution to
this but encourage feedback on my ByteSource commits since some of this
API redesign is not straightforward.

-- 
Andrew Gaul
http://gaul.org/

Re: JENKINS-23049

Posted by Andrew Phillips <ap...@qrmedia.com>.
> I've just seen JENKINS-23049 [1], and I recall some changes in jclouds
> to fix this.

By the looks of it, this behaviour would be expected? Trying to upload  
a blob with a payload but no content length seems to be supposed to  
fail [1]. See JCLOUDS-508 [2] for a related comment, and an answer  
from Gaul to a Stack Overflow question [3].

The only vaguely recent (over a year ago ;-)) change I can think of  
relating to content length is [4], but that's at a really low level.

Hope that helps!

ap

[1]  
https://github.com/jclouds/jclouds/blob/master/apis/s3/src/test/java/org/jclouds/s3/binders/BindS3ObjectMetadataToRequestTest.java#L79
[2] https://issues.apache.org/jira/browse/JCLOUDS-508
[3]  
http://stackoverflow.com/questions/22105240/jclouds-s3-specify-content-length-when-uploading-file
[4] https://github.com/jclouds/jclouds/commit/843ed57c8a