Uploaded image for project: 'Apache HAWQ'
  1. Apache HAWQ
  2. HAWQ-1334

QD thread should set error code if failing so that the main process for the query could exit soon

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.0.0-incubating
    • Component/s: Dispatcher
    • Labels:
      None

      Description

      In QD thread function dispmgt_thread_func_run(), if there are failures either due to QE or QD itself, it will cancel the query and then clean up. The main process for the query needs the error code of meleeResults be set so that it soon proceeds to cancel the query, else we have to wait for timeout. Typically dispmgt_thread_func_run() should set the error code, however I found there are some cases who do not handle this, e.g. if poll() fails with ENOMEM. One symptom of this issue is that we could sometimes see hang if a query is canceled for some reasons.

      The potential solution is that:

      1) We expect each branch jump ("goto error_cleanup") set proper error code itself. It is not an easy job.
      2) We add a "guard" function in the error_cleanup code to set an error code if it is not set, i.e. 1) is not well done.

      I'd this JIRA cares about 2).

      In general, the cleanup code in QD seems to be really obscure and not elegant. Maybe we should file another JIRA to refactor the error handling logic in it.

        Attachments

          Activity

            People

            • Assignee:
              Paul Guo Paul Guo
              Reporter:
              Paul Guo Paul Guo

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment