niteshsarda commented on a change in pull request #2224: CLOUDSTACK-10032 : Database entries for templates created from snapshots disappear after management-server service restart URL: https://github.com/apache/cloudstack/pull/2224#discussion_r131579351
########## File path: services/secondary-storage/server/src/org/apache/cloudstack/storage/resource/NfsSecondaryStorageResource.java ########## @@ -525,6 +525,8 @@ protected Answer copySnapshotToTemplateFromNfsToNfs(CopyCommand cmd, SnapshotObj bufferWriter.write("\n"); long size = _storage.getSize(destFileFullPath); bufferWriter.write("size=" + size); + bufferWriter.close(); Review comment: @rhtyd : We already have try-with-resource declaration for the bufferWriter. But here we need to explicitly close this bufferWriter because in below code within try block , call is being made to save() method of TemplateLocation class where one more bufferWriter comes into picture for writing few other properties in Template.properties file. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services