Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5056

UserException does not write full message to log

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.0
    • Fix Version/s: 1.11.0
    • Component/s: None
    • Labels:

      Description

      A case occurred in which the External Sort failed during spilling. All that was written to the log was:

      2016-11-18 ... INFO  o.a.d.e.p.i.xsort.ExternalSortBatch - User Error Occurred
      

      As it turns out, there are two places in external sort that can throw a user exception. But, because the log contains neither line numbers nor detailed messages, it is not obvious which one was the cause.

      When logging a user error, include the text provided when building the error. For example, consider the following external sort code:

            throw UserException.resourceError(e)
              .message("External Sort encountered an error while spilling to disk")
                    .addContext(e.getMessage() /* more detail */)
              .build(logger);
      

      The expected message is:

      2016-11-18 ... INFO  o.a.d.e.p.i.xsort.ExternalSortBatch - User Error Occurred: External Sort encountered an error while spilling to disk (Disk write failed) 
      

      The part in parens is the cause of the error: the e.getMessage( ) in the above code.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paul-rogers Paul Rogers
                Reporter:
                paul-rogers Paul Rogers
                Reviewer:
                Boaz Ben-Zvi
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: