[jira] [Commented] (OAK-8052) PersistentCache: failure during construction may lead to resource leak
[ https://issues.apache.org/jira/browse/OAK-8052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16773955#comment-16773955 ] Julian Reschke commented on OAK-8052: - trunk: [r1854034|http://svn.apache.org/r1854034] > PersistentCache: failure during construction may lead to resource leak > -- > > Key: OAK-8052 > URL: https://issues.apache.org/jira/browse/OAK-8052 > Project: Jackrabbit Oak > Issue Type: Bug > Components: documentmk >Reporter: Julian Reschke >Assignee: Julian Reschke >Priority: Minor > Labels: candidate_oak_1_10, candidate_oak_1_6, candidate_oak_1_8 > Fix For: 1.12, 1.11.0 > > Attachments: OAK-8052.diff > > > In the constructor: > {noformat} > readGeneration = generations.size() > 1 ? generations.first() : -1; > writeGeneration = generations.size() > 0 ? generations.last() : 0; > if (readGeneration >= 0) { > readStore = createMapFactory(readGeneration, true); > } > writeStore = createMapFactory(writeGeneration, false); > initBroadcast(broadcast); > {noformat} > ...so if {{createMapFactory}} fails for {{writeStore}}, {{readStore}} will > not be closed. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OAK-8052) PersistentCache: failure during construction may lead to resource leak
[ https://issues.apache.org/jira/browse/OAK-8052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16773804#comment-16773804 ] Thomas Mueller commented on OAK-8052: - The patch looks good to me. > PersistentCache: failure during construction may lead to resource leak > -- > > Key: OAK-8052 > URL: https://issues.apache.org/jira/browse/OAK-8052 > Project: Jackrabbit Oak > Issue Type: Bug > Components: documentmk >Reporter: Julian Reschke >Priority: Minor > Labels: candidate_oak_1_10, candidate_oak_1_6, > candidate_oak_1_8, patch-available > Fix For: 1.12 > > Attachments: OAK-8052.diff > > > In the constructor: > {noformat} > readGeneration = generations.size() > 1 ? generations.first() : -1; > writeGeneration = generations.size() > 0 ? generations.last() : 0; > if (readGeneration >= 0) { > readStore = createMapFactory(readGeneration, true); > } > writeStore = createMapFactory(writeGeneration, false); > initBroadcast(broadcast); > {noformat} > ...so if {{createMapFactory}} fails for {{writeStore}}, {{readStore}} will > not be closed. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (OAK-8052) PersistentCache: failure during construction may lead to resource leak
[ https://issues.apache.org/jira/browse/OAK-8052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16769296#comment-16769296 ] Julian Reschke commented on OAK-8052: - Proposed patch: [^OAK-8052.diff] - unfortunately I couldn't figure out how to unit-test yet. [~tmueller] - can you review? > PersistentCache: failure during construction may lead to resource leak > -- > > Key: OAK-8052 > URL: https://issues.apache.org/jira/browse/OAK-8052 > Project: Jackrabbit Oak > Issue Type: Bug > Components: documentmk >Reporter: Julian Reschke >Assignee: Julian Reschke >Priority: Minor > Attachments: OAK-8052.diff > > > In the constructor: > {noformat} > readGeneration = generations.size() > 1 ? generations.first() : -1; > writeGeneration = generations.size() > 0 ? generations.last() : 0; > if (readGeneration >= 0) { > readStore = createMapFactory(readGeneration, true); > } > writeStore = createMapFactory(writeGeneration, false); > initBroadcast(broadcast); > {noformat} > ...so if {{createMapFactory}} fails for {{writeStore}}, {{readStore}} will > not be closed. -- This message was sent by Atlassian JIRA (v7.6.3#76005)