예제 #1
0
    def OnSourceQueryError(self, srcQueryId, exception):
        """Receive a message from the source manager about a problem that
        :param srcQueryId:
        :param exception:
        occurred when running the source query"""

        try:
            # log the source's exception
            # print out the source query id and the message
            logging.error("Source Query error for: " + str(srcQueryId) +
                          " : " + quilt_core.exception_to_string(exception))

            # I guess exception's don't keep their stacktrace over the pyro
            #   boundary
            # logging.exception(exception)

            # lock self to modify member data
            with self._lock:
                # mark source query state with ERROR
                srcQuerySpec = quilt_data.src_query_spec_get(
                    self._srcQuerySpecs, srcQueryId)
                quilt_data.src_query_spec_set(srcQuerySpec,
                                              state=quilt_data.STATE_ERROR)
                qid = quilt_data.query_spec_get(srcQuerySpec, name=True)

            # call query Master's Error function
            with self.GetQueryMasterProxy() as qm:
                qm.OnQueryError(qid, exception)

        except Exception, error2:
            logging.error("Unable to send source query error to query master")
            logging.exception(error2)
예제 #2
0
    def OnSubmitProblem(self, queryId, exception):
        """Receive a message from the query master about a problem with
        the query submission"""

        try:
            # print out the query id and the message
            logging.error("Query submission error for: " + str(queryId) +
                          " : " + quilt_core.exception_to_string(exception))

            # I guess exception's don't keep their stacktrace over the pyro boundary
            #            logging.exception(exception)

        finally:
            # set process events flag to false end event loop, allowing
            # submitter to exit
            self.SetProcesssEvents(False)
예제 #3
0
            # multiple source errors can trigger this, so it is reasonable to 
            # expect multiple calls
            with self.lock:
                # mark the query as completed in state
                self._try_move_query_to_hist(
                    qid, quilt_data.STATE_ERROR)

        except Exception, e:
            logging.error("Unable to properly process query error")
            logging.exception(e)
            raise

        finally:
            # log the execution
            logging.error("Error occurred when processing query: " + str(qid))
            logging.error(quilt_core.exception_to_string(error))

    def BeginQuery(self, queryId):
        """
        string queryID          # the query we are interested in
        
        Called by quilt_query to Move a query into the an active state,
        and return a copy of the query
        """

        try:
            logging.info("Beginning query: " + str(queryId))
            patternSpec = None

            # lock self
            with self.lock: