[
https://issues.apache.org/jira/browse/CLOUDSTACK-9062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013472#comment-15013472
]
ASF GitHub Bot commented on CLOUDSTACK-9062:
--------------------------------------------
Github user wilderrodrigues commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1083#discussion_r45335913
--- Diff: core/src/com/cloud/storage/template/S3TemplateDownloader.java ---
@@ -342,47 +274,38 @@ public InputStream getS3ObjectInputStream() {
return null;
}
- return S3Utils.getObjectStream(s3to, s3to.getBucketName(), s3Key);
+ return S3Utils.getObjectStream(s3TO, s3TO.getBucketName(), s3Key);
}
public void cleanupAfterError() {
- if (status != Status.UNRECOVERABLE_ERROR) {
- s_logger.debug("S3Template downloader does not have state
UNRECOVERABLE_ERROR, no cleanup neccesarry.");
- return;
- }
-
- s_logger.info("Cleanup after UNRECOVERABLE_ERROR, trying to remove
object: " + s3Key);
+ LOGGER.warn("Cleanup after error, trying to remove object: " +
s3Key);
- S3Utils.deleteObject(s3to, s3to.getBucketName(), s3Key);
+ S3Utils.deleteObject(s3TO, s3TO.getBucketName(), s3Key);
}
@Override
- @SuppressWarnings("fallthrough")
public boolean stopDownload() {
- switch (getStatus()) {
- case IN_PROGRESS:
- if (request != null) {
- request.abort();
- }
- status = TemplateDownloader.Status.ABORTED;
- return true;
- case UNKNOWN:
- case NOT_STARTED:
- case RECOVERABLE_ERROR:
- case UNRECOVERABLE_ERROR:
- case ABORTED:
- status = TemplateDownloader.Status.ABORTED;
- case DOWNLOAD_FINISHED:
- try {
- S3Utils.deleteObject(s3to, s3to.getBucketName(), s3Key);
- } catch (Exception ex) {
- // ignore delete exception if it is not there
- }
- return true;
-
- default:
- return true;
+ switch (status) {
--- End diff --
Same here: let's refactor this in the a second round. Now we can merge, but
let's improve. :)
> Upgrade AWS SDK to latest version.
> ----------------------------------
>
> Key: CLOUDSTACK-9062
> URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9062
> Project: CloudStack
> Issue Type: Improvement
> Security Level: Public(Anyone can view this level - this is the
> default.)
> Components: Secondary Storage
> Affects Versions: 4.6.0
> Reporter: Boris Schrijver
> Assignee: Boris Schrijver
>
> Upgrade AWS SDK to latest version.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)