Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-19391

RowContainer.setupWriter hangs when the file creation failed

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsAdd voteVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0.0
    • None
    • SQL
    • None

    Description

      The while loop in the RowContainer.setupWriter function hangs endlessly when the file creation failed, causing the delete() returns false.

      The file creation failure can be caused by different reasons, e.g., disk full.

      Here is the code snippet.

       

        protected void setupWriter() throws HiveException {
          try {
      
            if ( tmpFile != null ) {
              return;
            }
      
            String suffix = ".tmp";
            if (this.keyObject != null) {
              suffix = "." + this.keyObject.toString() + suffix;
            }
      
            while (true) {
              parentFile = File.createTempFile("hive-rowcontainer", ""); //file creation failed
              boolean success = parentFile.delete() && parentFile.mkdir(); //delete returns false
              if (success) {
                break;
              }
              LOG.debug("retry creating tmp row-container directory...");
            }
            ...
        }
      

      Attachments

        Activity

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

          People

            Unassigned Unassigned Assign to me
            dustinday John Doe

            Dates

              Created:
              Updated:

              Slack

                Issue deployment