code: public void grantResource(
      Session session, ResourceRequestInfo req, ResourceGrant grant) {
      session.grantResource(req, grant);
      if (session.getPendingRequestCount() <= 0) {
        runnableSessions.remove(session.getSessionId());
      }
    }
docs: Unlike other api's defined by the SessionManager - this one is invoked by
  the scheduler when it already has a lock on the session and has a valid
  session handle. The call is routed through the SessionManager to make sure
  that any indices/views maintained on top of the sessions are maintained
  accurately