-
Notifications
You must be signed in to change notification settings - Fork 17
Drain entire download stream #830
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
Conversation
Issue: 107019
Cherry pick to beta success |
gxcloudstorage-awss3-v1/src/main/java/com/genexus/db/driver/ExternalProviderS3V1.java
Outdated
Show resolved
Hide resolved
Cherry pick to beta success |
} | ||
} | ||
} catch (FileNotFoundException ex) { | ||
logger.error("Error while downloading file to the external provider", ex); | ||
} catch (IOException ex) { | ||
logger.error("Error while downloading file to the external provider", ex); | ||
} finally { | ||
try {objectData.close();} catch (IOException ioe) {logger.error("Error while draining the S3ObjectInputStream", ioe);} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will crash if objectData is null.
Ant the Finally should be in the LAST try.
} catch (IOException e) { | ||
logger.error("Error while processing the input stream", e); | ||
} finally { | ||
objectData.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed? You are inside a Try resource code. Thw clous will be done automatically.
Cherry pick to beta success |
Cherry pick to beta success |
} | ||
} catch (FileNotFoundException ex) { | ||
logger.error("Error while downloading file to the external provider", ex); | ||
} catch (IOException ex) { | ||
logger.error("Error while downloading file to the external provider", ex); | ||
} finally { | ||
try {objectData.close();} catch (IOException ioe) {logger.error("Error while draining the S3ObjectInputStream", ioe);} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry! The location of the catch was ok!
The missing was the IF condition. Now it's ok, bute you need to restore the finally position to the original place.
Cherry pick to beta success |
Issue: 107019