Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-6380

SSTableReader.loadSummary may leave an open file

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: 2.0.3
    • Component/s: None
    • Labels:
      None

      Description

      When SSTableReader.loadSummary catches IOException it tries to delete summariesFile, but the iStream is still open and the file is locked, so FileUtils.deleteWithConfirm fails, at least on Windows

        Activity

        Hide
        mishail Mikhail Stepura added a comment -

        Attaching the patch to close the stream to unlock the file

        Show
        mishail Mikhail Stepura added a comment - Attaching the patch to close the stream to unlock the file
        Hide
        yukim Yuki Morishita added a comment -

        'finally' block does close iStream, so I think there isn't a problem in current code.

        Show
        yukim Yuki Morishita added a comment - 'finally' block does close iStream, so I think there isn't a problem in current code.
        Hide
        jbellis Jonathan Ellis added a comment - - edited

        LGTM; committed

        (Didn't see Yuki's comment. The problem is that the catch block runs before the finally, so it tries to delete before the close, which works on linux but not windows.)

        Show
        jbellis Jonathan Ellis added a comment - - edited LGTM; committed (Didn't see Yuki's comment. The problem is that the catch block runs before the finally, so it tries to delete before the close, which works on linux but not windows.)

          People

          • Assignee:
            mishail Mikhail Stepura
            Reporter:
            mishail Mikhail Stepura
            Reviewer:
            Jonathan Ellis
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development