Return-Path: X-Original-To: apmail-incubator-whirr-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-whirr-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C2CD96706 for ; Fri, 29 Jul 2011 10:01:54 +0000 (UTC) Received: (qmail 35359 invoked by uid 500); 29 Jul 2011 10:01:54 -0000 Delivered-To: apmail-incubator-whirr-dev-archive@incubator.apache.org Received: (qmail 35135 invoked by uid 500); 29 Jul 2011 10:01:41 -0000 Mailing-List: contact whirr-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: whirr-dev@incubator.apache.org Delivered-To: mailing list whirr-dev@incubator.apache.org Received: (qmail 35125 invoked by uid 99); 29 Jul 2011 10:01:35 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 10:01:35 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jul 2011 10:01:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E5AE191C1B for ; Fri, 29 Jul 2011 10:01:09 +0000 (UTC) Date: Fri, 29 Jul 2011 10:01:09 +0000 (UTC) From: "Adrian Cole (JIRA)" To: whirr-dev@incubator.apache.org Message-ID: <432677347.18200.1311933669800.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <791965039.18083.1311926770340.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (WHIRR-349) Retry if blobstore put fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/WHIRR-349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13072760#comment-13072760 ] Adrian Cole commented on WHIRR-349: ----------------------------------- the code in BlobCache needs to be revised. jclouds will by default retry any replayable payloads. InputStreams are not replayable. Looks like the smoking gun is here where a file is converted to a stream: public synchronized void putIfAbsent(File file) throws FileNotFoundException { putIfAbsent(file.getName(), new FileInputStream(file), file.length()); } It is better to send the File, byte[], String, etc. directly than do this. All of those payloads are retryable. I hope this helps. P.S. we should use BlobBuilder in BlobCache as it looks nicer > Retry if blobstore put fails > ---------------------------- > > Key: WHIRR-349 > URL: https://issues.apache.org/jira/browse/WHIRR-349 > Project: Whirr > Issue Type: Improvement > Components: core > Affects Versions: 0.6.0 > Environment: Ubuntu 11.04 > java version "1.6.0_26" > Java(TM) SE Runtime Environment (build 1.6.0_26-b03) > Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode) > (using https://github.com/bdumon/whirr 13cd70e which uses a jclouds 1.1.0-SNAPSHOT) > Reporter: Karel Vervaeke > Priority: Minor > Original Estimate: 4h > Remaining Estimate: 4h > > When the blobstore fails to upload a file, it might be worth retrying a couple of times rather than just aborting > the whole process. > OTOH, the failure would occur *before* any machines are launched, so the loss is limited. > Here's an example stacktrace of a failed upload: > Created blob cache container 'fr6mxqa4d6aa' located in '[id=EU, scope=REGION, description=EU, parent=aws-s3, iso3166Codes=[IE], metadata={}]' > Uploading 'mydecorator-1.0-SNAPSHOT.tar.gz' to 'fr6mxqa4d6aa' blob cache. > Jul 29, 2011 8:53:50 AM org.jclouds.logging.jdk.JDKLogger logWarn > WARNING: Cannot retry after server error, command is not replayable: [method=AWSS3AsyncClient.putObject, request=PUT https://fr6mxqa4d6aa.s3.amazonaws.com/mydecorator-1.0-SNAPSHOT.tar.gz HTTP/1.1] > Exception in thread "main" org.jclouds.http.HttpResponseException: error after writing 335872/637480 bytes to PUT https://fr6mxqa4d6aa.s3.amazonaws.com/mydecorator-1.0-SNAPSHOT.tar.gz HTTP/1.1 connecting to PUT https://fr6mxqa4d6aa.s3.amazonaws.com/mydecorator-1.0-SNAPSHOT.tar.gz HTTP/1.1 > at org.jclouds.http.internal.BaseHttpCommandExecutorService$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:183) > at org.jclouds.http.internal.BaseHttpCommandExecutorService$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:134) > at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) > at java.util.concurrent.FutureTask.run(FutureTask.java:166) > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) > at java.lang.Thread.run(Thread.java:679) > Caused by: java.lang.RuntimeException: error after writing 335872/637480 bytes to PUT https://fr6mxqa4d6aa.s3.amazonaws.com/mydecorator-1.0-SNAPSHOT.tar.gz HTTP/1.1 > at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:245) > at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:77) > at org.jclouds.http.internal.BaseHttpCommandExecutorService$HttpResponseCallable.call(BaseHttpCommandExecutorService.java:156) > ... 6 more > Caused by: java.io.IOException: Error writing request body to server > at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:2716) > at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:2699) > at com.google.common.io.CountingOutputStream.write(CountingOutputStream.java:51) > at com.google.common.io.ByteStreams.copy(ByteStreams.java:172) > at org.jclouds.io.payloads.BasePayload.writeTo(BasePayload.java:67) > at org.jclouds.http.internal.JavaUrlHttpCommandExecutorService.convert(JavaUrlHttpCommandExecutorService.java:243) > ... 8 more > Removing blob cache 'fr6mxqa4d6aa' -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira