Cancel grant on a node
@param nodeName the node the grant is on
@param sessionId the session the grant was given to
@param requestId the request this grant satisfied
519429
public void cancelGrant(String nodeName, String sessionId, int requestId) {
    ClusterNode node = nameToNode.get(nodeName);
    if (node == null) {
      LOG.warn("Canceling grant for non-existent node: " + nodeName);
      return;
    }
    synchronized (node) {
      if (node.deleted) {
        LOG.warn("Canceling grant for deleted node: " + nodeName);
        return;
      }
      String hoststr = node.getClusterNodeInfo().getAddress().getHost();
      if (!canAllowNode(hoststr)) {
        LOG.warn("Canceling grant for excluded node: " + hoststr);
        return;
      }
      ResourceRequestInfo req = node.getRequestForGrant(sessionId, requestId);
      if (req != null) {
        ResourceRequest unitReq = Utilities.getUnitResourceRequest(
          req.getType());
        boolean previouslyRunnable = node.checkForGrant(unitReq, resourceLimit);
        node.cancelGrant(sessionId, requestId);
        loadManager.decrementLoad(req.getType());
        if (!previouslyRunnable && node.checkForGrant(unitReq, resourceLimit)) {
          RunnableIndices r = typeToIndices.get(req.getType());
          if (!faultManager.isBlacklisted(node.getName(), req.getType())) {
            r.addRunnable(node);
          }
        }
      }
    }
  }
406801
public synchronized USER remove(final ID sessionId)
	{
		final USER user = getUser(sessionId);
		if (user != null)
		{
			usersOnline.remove(user);
		}
		sessionIdToUser.remove(sessionId);
		return user;
	}
739862
ServerSessionContext unregisterSession(long sessionId) {
    ServerSessionContext session = sessions.remove(sessionId);
    if (session != null) {
      clients.remove(session.client(), session);
      connections.remove(session.client(), session.getConnection());
    }
    return session;
  }
173385
public void doDelete(@Param("nodeId") Long nodeId, @Param("pageIndex") int pageIndex,
                         @Param("searchKey") String searchKey, Navigator nav) throws WebxException {

        if (pipelineService.hasRelation(nodeId) || nodeService.findById(nodeId).getStatus().isStart()) {
            nav.redirectTo(WebConstant.ERROR_FORBIDDEN_Link);
            return;
        } else {
            nodeService.remove(nodeId);
        }

        nav.redirectToLocation("nodeList.htm?pageIndex=" + pageIndex + "&searchKey=" + urlEncode(searchKey));
    }
584908
public boolean canHitMemcached(final String sessionId) {
		if ( isEncodeNodeIdInSessionId() ) {
	        final String nodeId = _sessionIdFormat.extractMemcachedId( sessionId );
	        if ( nodeId == null ) {
	            LOG.debug( "The sessionId does not contain a nodeId so that the memcached node could not be identified." );
	            return false;
	        }
			if ( !_nodeIdService.isNodeAvailable( nodeId ) ) {
	            LOG.debug( "The node "+ nodeId +" is not available, therefore " + sessionId + " cannot be loaded from this memcached." );
	            return false;
	        }
		}
		return true;
	}
1155297
private void cancelAcquire(Node node) {
        // Ignore if node doesn't exist
        if (node == null)
            return;

        node.thread = null;

        // Skip cancelled predecessors
        Node pred = node.prev;
        while (pred.waitStatus > 0)
            node.prev = pred = pred.prev;

        // predNext is the apparent node to unsplice. CASes below will
        // fail if not, in which case, we lost race vs another cancel
        // or signal, so no further action is necessary.
        Node predNext = pred.next;

        // Can use unconditional write instead of CAS here.
        // After this atomic step, other Nodes can skip past us.
        // Before, we are free of interference from other threads.
        node.waitStatus = Node.CANCELLED;

        // If we are the tail, remove ourselves.
        if (node == tail && compareAndSetTail(node, pred)) {
            pred.compareAndSetNext(predNext, null);
        } else {
            // If successor needs signal, try to set pred's next-link
            // so it will get one. Otherwise wake it up to propagate.
            int ws;
            if (pred != head &&
                ((ws = pred.waitStatus) == Node.SIGNAL ||
                 (ws <= 0 && pred.compareAndSetWaitStatus(ws, Node.SIGNAL))) &&
                pred.thread != null) {
                Node next = node.next;
                if (next != null && next.waitStatus <= 0)
                    pred.compareAndSetNext(predNext, next);
            } else {
                unparkSuccessor(node);
            }

            node.next = node; // help GC
        }
    }
393662
public void deleteRequestGroup(String requestGroupId) {
    final Function<String, String> requestUri = (host) -> String.format(REQUEST_GROUP_FORMAT, getApiBase(host), requestGroupId);

    delete(requestUri, "request group", requestGroupId);
  }
1211762
public void removeSessionAttr(final String attrName) {
    final HttpSession sess = request.getSession(false);

    if (sess == null) {
      return;
    }

    sess.removeAttribute(attrName);
  }
1194074
public static void removeRequest (@Nonnull @Nonempty final String sRequestID)
  {
    final RequestTracker aTracker = getGlobalSingletonIfInstantiated (RequestTracker.class);
    if (aTracker != null)
      aTracker.m_aRequestTrackingMgr.removeRequest (sRequestID, s_aParallelRunningCallbacks);
  }
173880
public static synchronized void cancelNetworkCall(String url, String requestMethod, long endTime, String exception) {
    if (url != null) {
      String id = sanitiseURL(url);
      if ((connections != null) && (connections.containsKey(id))) {
        connections.remove(id);
      }
    }
  }
1216725
function setRequestId(id, cb) {
  var ns = getLoggerNamespace();
  ns.run(function() {
    ns.set('requestId', id);
    cb();
  });
}
398124
public void retainNode(String id) {
        synchronized (retainedNodes) {
            Node current = getCurrentNode();

            if (current != null) {
                retainedNodes.put(id, current);
            }
        }
    }
889104
public RefreshSessionResponse refreshSession(String sessionId) {
        RefreshSessionRequest request = new RefreshSessionRequest();
        request.setSessionId(sessionId);
        return refreshSession(request);
    }
1090967
@Override
	public void deleteSession(String sessionName) {
		logger.debug("deleteSession " + sessionName);
	    if (databaseServer == null) {
	    	return;
	    }
        databaseServer = null;
    }
1359601
public void forceDisconnect(String sessionId, String connectionId) throws OpenTokException , InvalidArgumentException, RequestException {
        if (sessionId == null || sessionId.isEmpty() || connectionId == null || connectionId.isEmpty()) {
            throw new InvalidArgumentException("Session or Connection string null or empty");
        }
        try {
            this.client.forceDisconnect(sessionId, connectionId);

        } catch (Exception e)
        {
            throw e;
        }
    }
16610
@Override
    public Response cancelReserveRN(String CorpNum, String requestNum) throws PopbillException {
        return cancelReserveRN(CorpNum, requestNum, null);
    }
507283
def cancelRequest(self, requestId, reason=None, _=None):
        
        if reason is None:
            reason = CancelledError()
        tReq = self.requests.pop(requestId)
        tReq.d.errback(reason)