void qm_traceQUEUE_SEND_FAILED(void* xQueue) {
  if(initialized) {
    Data* queueData = getQueueData(xQueue);

    queueData->fullCount++;
  }
}
void qm_traceQUEUE_SEND(void* xQueue) {
  if(initialized) {
    Data* queueData = getQueueData(xQueue);

    queueData->sendCount++;
    queueData->maxWaiting = getMaxWaiting(xQueue, queueData->maxWaiting);
  }
}
Beispiel #3
0
int
ctrlQueue (struct controlReq *qcReq, struct lsfAuth *auth)
{
  struct qData *qp;

  if ((qp = getQueueData (qcReq->name)) == NULL)
    return (LSBE_BAD_QUEUE);

  if (!isAuthManager (auth) && auth->uid != 0 && !isAuthQueAd (qp, auth))
    {
      ls_syslog (LOG_CRIT, I18N (7511, "ctrlQueue: uid <%d> not allowed to perform control operation"), auth->uid);	/* catgets 7511 */
      return (LSBE_PERMISSION);
    }

  if ((qcReq->opCode < QUEUE_OPEN) || (qcReq->opCode > QUEUE_INACTIVATE))
    return (LSBE_LSBLIB);

  if (qcReq->opCode == QUEUE_ACTIVATE && !(qp->qStatus & QUEUE_STAT_RUN))
    {
      qp->qStatus |= QUEUE_STAT_ACTIVE;
      log_queuestatus (qp, qcReq->opCode, auth->uid, auth->lsfUserName);
      return (LSBE_QUEUE_WINDOW);
    }

  if (((qp->qStatus & QUEUE_STAT_OPEN) &&
       (qcReq->opCode == QUEUE_OPEN))
      || (!(qp->qStatus & QUEUE_STAT_OPEN) &&
	  (qcReq->opCode == QUEUE_CLOSED))
      || ((qp->qStatus & QUEUE_STAT_ACTIVE) &&
	  (qcReq->opCode == QUEUE_ACTIVATE))
      || (!(qp->qStatus & QUEUE_STAT_ACTIVE) &&
	  (qcReq->opCode == QUEUE_INACTIVATE)))
    return (LSBE_NO_ERROR);

  if (qcReq->opCode == QUEUE_OPEN)
    {
      qp->qStatus |= QUEUE_STAT_OPEN;
      log_queuestatus (qp, qcReq->opCode, auth->uid, auth->lsfUserName);
    }
  if (qcReq->opCode == QUEUE_CLOSED)
    {
      qp->qStatus &= ~QUEUE_STAT_OPEN;
      log_queuestatus (qp, qcReq->opCode, auth->uid, auth->lsfUserName);
    }
  if (qcReq->opCode == QUEUE_ACTIVATE)
    {
      qp->qStatus |= QUEUE_STAT_ACTIVE;
      log_queuestatus (qp, qcReq->opCode, auth->uid, auth->lsfUserName);
    }
  if (qcReq->opCode == QUEUE_INACTIVATE)
    {
      qp->qStatus &= ~QUEUE_STAT_ACTIVE;
      log_queuestatus (qp, qcReq->opCode, auth->uid, auth->lsfUserName);
    }
  return (LSBE_NO_ERROR);

}
Beispiel #4
0
void
asyncCancelRequest (AsyncHandle handle) {
  Element *element = asyncGetHandleElement(handle, ASYNC_ANY_QUEUE);

  asyncDiscardHandle(handle);

  if (element) {
    Queue *queue = getElementQueue(element);
    const AsyncQueueMethods *methods = getQueueData(queue);

    if (methods) {
      if (methods->cancelRequest) {
        methods->cancelRequest(element);
        return;
      }
    }

    deleteElement(element);
  }
}