[jira] [Commented] (OAK-5787) BlobStore should be AutoCloseable
[ https://issues.apache.org/jira/browse/OAK-5787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17059978#comment-17059978 ] Julian Reschke commented on OAK-5787: - trunk: (1.22.0) [r1871267|http://svn.apache.org/r1871267] 1.22: (1.22.0) [r1871267|http://svn.apache.org/r1871267] > BlobStore should be AutoCloseable > - > > Key: OAK-5787 > URL: https://issues.apache.org/jira/browse/OAK-5787 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: blob >Reporter: Julian Reschke >Assignee: Julian Reschke >Priority: Minor > Labels: candidate_oak_1_10 > Fix For: 1.22.0 > > Attachments: OAK-5787.diff > > > {{DocumentNodeStore}} currently calls {{close()}} if the blob store instance > implements {{Closeable}}. > This has led to problems where wrapper implementations did not implement it, > and thus the actual blob store instance wasn't properly shut down. > Proposal: make {{BlobStore}} extend {{Closeable}} and get rid of all > {{instanceof}} checks. > [~thomasm] [~amitjain] - feedback appreciated. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OAK-5787) BlobStore should be AutoCloseable
[ https://issues.apache.org/jira/browse/OAK-5787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16994394#comment-16994394 ] Thomas Mueller commented on OAK-5787: - +1 > BlobStore should be AutoCloseable > - > > Key: OAK-5787 > URL: https://issues.apache.org/jira/browse/OAK-5787 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: blob >Reporter: Julian Reschke >Assignee: Julian Reschke >Priority: Minor > Fix For: 1.22.0 > > Attachments: OAK-5787.diff > > > {{DocumentNodeStore}} currently calls {{close()}} if the blob store instance > implements {{Closeable}}. > This has led to problems where wrapper implementations did not implement it, > and thus the actual blob store instance wasn't properly shut down. > Proposal: make {{BlobStore}} extend {{Closeable}} and get rid of all > {{instanceof}} checks. > [~thomasm] [~amitjain] - feedback appreciated. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OAK-5787) BlobStore should be AutoCloseable
[ https://issues.apache.org/jira/browse/OAK-5787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16994385#comment-16994385 ] Marcel Reutegger commented on OAK-5787: --- Looks good to me. > BlobStore should be AutoCloseable > - > > Key: OAK-5787 > URL: https://issues.apache.org/jira/browse/OAK-5787 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: blob >Reporter: Julian Reschke >Assignee: Julian Reschke >Priority: Minor > Fix For: 1.22.0 > > Attachments: OAK-5787.diff > > > {{DocumentNodeStore}} currently calls {{close()}} if the blob store instance > implements {{Closeable}}. > This has led to problems where wrapper implementations did not implement it, > and thus the actual blob store instance wasn't properly shut down. > Proposal: make {{BlobStore}} extend {{Closeable}} and get rid of all > {{instanceof}} checks. > [~thomasm] [~amitjain] - feedback appreciated. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OAK-5787) BlobStore should be AutoCloseable
[ https://issues.apache.org/jira/browse/OAK-5787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16975090#comment-16975090 ] Julian Reschke commented on OAK-5787: - Good idea. > BlobStore should be AutoCloseable > - > > Key: OAK-5787 > URL: https://issues.apache.org/jira/browse/OAK-5787 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: blob >Reporter: Julian Reschke >Assignee: Julian Reschke >Priority: Minor > Fix For: 1.22.0 > > Attachments: OAK-5787.diff > > > {{DocumentNodeStore}} currently calls {{close()}} if the blob store instance > implements {{Closeable}}. > This has led to problems where wrapper implementations did not implement it, > and thus the actual blob store instance wasn't properly shut down. > Proposal: make {{BlobStore}} extend {{Closeable}} and get rid of all > {{instanceof}} checks. > [~thomasm] [~amitjain] - feedback appreciated. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OAK-5787) BlobStore should be AutoCloseable
[ https://issues.apache.org/jira/browse/OAK-5787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16975071#comment-16975071 ] Thomas Mueller commented on OAK-5787: - For DefaultSplitBlobStore, if both thrown exception, the first one is lost. I think a solution would be to use addSuppressed (available in Java 1.7): {noformat} + +@Override +public void close() throws Exception { +Exception thrown = null; +try { +oldBlobStore.close(); +} catch (Exception ex) { +thrown = ex; +} +try { +newBlobStore.close(); +} catch (Exception ex) { +if (thrown != null) { +thrown.addSuppressed(ex); +} else { +thrown = ex; +} +} +if (thrown != null) { +throw thrown; +} +} {noformat} > BlobStore should be AutoCloseable > - > > Key: OAK-5787 > URL: https://issues.apache.org/jira/browse/OAK-5787 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: blob >Reporter: Julian Reschke >Assignee: Julian Reschke >Priority: Minor > Fix For: 1.22.0 > > Attachments: OAK-5787.diff > > > {{DocumentNodeStore}} currently calls {{close()}} if the blob store instance > implements {{Closeable}}. > This has led to problems where wrapper implementations did not implement it, > and thus the actual blob store instance wasn't properly shut down. > Proposal: make {{BlobStore}} extend {{Closeable}} and get rid of all > {{instanceof}} checks. > [~thomasm] [~amitjain] - feedback appreciated. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (OAK-5787) BlobStore should be AutoCloseable
[ https://issues.apache.org/jira/browse/OAK-5787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16975055#comment-16975055 ] Julian Reschke commented on OAK-5787: - [~thomasm] - good point. Proposed patch: [^OAK-5787.diff] . Feedback appreciated [~amitjain], [~mreutegg] > BlobStore should be AutoCloseable > - > > Key: OAK-5787 > URL: https://issues.apache.org/jira/browse/OAK-5787 > Project: Jackrabbit Oak > Issue Type: Improvement > Components: blob >Reporter: Julian Reschke >Assignee: Julian Reschke >Priority: Minor > Fix For: 1.20.0 > > Attachments: OAK-5787.diff > > > {{DocumentNodeStore}} currently calls {{close()}} if the blob store instance > implements {{Closeable}}. > This has led to problems where wrapper implementations did not implement it, > and thus the actual blob store instance wasn't properly shut down. > Proposal: make {{BlobStore}} extend {{Closeable}} and get rid of all > {{instanceof}} checks. > [~thomasm] [~amitjain] - feedback appreciated. -- This message was sent by Atlassian Jira (v8.3.4#803005)