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

IOException unwrapping in CommitLogReader. readCommitLogSegment misses exceptions in resource creation block

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Low
    • Resolution: Unresolved
    • None
    • Local/Commit Log
    • None
    • Low

    Description

      CommitLogReader. readCommitLogSegment is unwrapping IOExceptions wrapped as RuntimeExceptions using a try-with-resource block.

      However, the resource specification block, RandomAccessReader reader = RandomAccessReader.open(file), could also throw such an exception, which is missed by the catch block and throws as a RuntimeException instead of an IOException.

      One such example that I've seen is:

      • RandomAccessReader.open (called in try-with-resource resource specification block initialization)
      • ChannelProxy(File) constructor
      • ChannelProxy.openChannel (wraps IOException as RuntimeException)

      I don't know what the impact in Cassandra could be, I ran into this while processing CDC/commit logs for synchronization with another system.
      Was using Cassandra 3.11.0

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned Assign to me
            cgrigoroscuta Catalin Grigoroscuta

            Dates

              Created:
              Updated:

              Slack

                Issue deployment