[ https://issues.apache.org/jira/browse/CASSANDRA-1178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877272#action_12877272 ]
Matthew F. Dennis commented on CASSANDRA-1178: ---------------------------------------------- intellij often automatically reorders imports and removes unused ones (they call it "optimizing imports"). I just let it do it's thing in this regard (to be honest I've just gotten in the habit of ignoring the import section). At least for get_slice, close is properly called (as evident by the patch fixing the problem). It may be the case that for other calls close is not correctly called, I didn't specifically look for such cases but 1) I haven't noticed a problem making other calls and 2) I didn't notice anything in the code while debugging this issue. In general I agree that self contained objects are better but that doesn't necessarily fit in this case as the open file is really a system resource. Given the way Java does GC, such resources should be explicitly released. I discussed this particular case with jbellis and the thought for the original patch that introduced this bug was that some callers would want to reuse an existing file. In such a case, they would be responsible for closing the file but that meant that SSTableSliceIterator shouldn't close it out from under them. > get_slice calls do not close files when finished resulting in "too many open > files" exceptions and rendering C unusable > ----------------------------------------------------------------------------------------------------------------------- > > Key: CASSANDRA-1178 > URL: https://issues.apache.org/jira/browse/CASSANDRA-1178 > Project: Cassandra > Issue Type: Bug > Affects Versions: 0.7 > Reporter: Matthew F. Dennis > Assignee: Matthew F. Dennis > Fix For: 0.7 > > Attachments: 0001-trunk-1178.patch > > > insert ~100K rows. Read them back in a loop. Notice "too many open files" > exceptions in log. SSTableSliceIterator is never closing the files. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.