Uploaded image for project: 'Nutch'
  1. Nutch
  2. NUTCH-2076

exceptions are not handled when using method waitForCompletion in a try block

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Auto Closed
    • 2.2, 2.3
    • 2.5
    • crawldb
    • None

    Description

      Locations: src\java\org\apache\nutch\crawl\WebTableReader.java
      when using function waitForCompletion in a try block, exceptions are not handled :

      waitForCompletion might throw : IOException, InterruptedException, ClassNotFoundException
      so when calling this function in a try block, we should use a catch block to handle potential Exceptions.

      public Map<String, Object> run(Map<String, Object> args) throws Exception {
      ...
      try

      { currentJob.waitForCompletion(true); }

      finally {
      ToolUtil.recordJobStatus(null, currentJob, results);
      if (!currentJob.isSuccessful())

      { fileSystem.delete(tmpFolder, true); return results; }

      }
      ...
      }

      Attachments

        Issue Links

        Activity

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

          People

            Unassigned Unassigned
            songwang songwanging
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment