fdbserver/ClusterController.actor.cpp
// When workers aren't available at the time of request, the request
// gets added to a list of outstanding reqs. Here, we try to resolve these
// outstanding requests.
When workers aren't available at the time of request, the request
gets added to a list of outstanding reqs. Here, we try to resolve these
outstanding requests.
When workers aren ' t available at the time of request the request gets added to a list of outstanding reqs . Here we try to resolve these outstanding requests .
void checkOutstandingBlobWorkerRequests(ClusterControllerData* self) {
	for (int i = 0; i < self->outstandingBlobWorkerRequests.size(); i++) {
		auto& req = self->outstandingBlobWorkerRequests[i];
		try {
			if (req.second < now()) {
				req.first.reply.sendError(timed_out());
				swapAndPop(&self->outstandingBlobWorkerRequests, i--);
			} else {
				if (!self->gotProcessClasses)
					throw no_more_servers();
				auto worker = self->getBlobWorker(req.first);
				RecruitBlobWorkerReply rep;
				rep.worker = worker.interf;
				rep.processClass = worker.processClass;
				req.first.reply.send(rep);
				swapAndPop(&self->outstandingBlobWorkerRequests, i--);
			}
		} catch (Error& e) {
			if (e.code() == error_code_no_more_servers) {
				TraceEvent(SevWarn, "RecruitBlobWorkerNotAvailable", self->id)
				    .suppressFor(1.0)
				    .detail("OutstandingReq", i)
				    .error(e);
			} else {
				TraceEvent(SevError, "RecruitBlobWorkerError", self->id).error(e);
				throw;
			}
		}
	}
}
void checkOutstandingBlobWorkerRequests ( ClusterControllerData * self ) { for ( int i = 0 ; i < self -> outstandingBlobWorkerRequests . size ( ) ; i ++ ) { auto & req = self -> outstandingBlobWorkerRequests [ i ] ; try { if ( req . second < now ( ) ) { req . first . reply . sendError ( timed_out ( ) ) ; swapAndPop ( & self -> outstandingBlobWorkerRequests , i -- ) ; } else { if ( ! self -> gotProcessClasses ) throw no_more_servers ( ) ; auto worker = self -> getBlobWorker ( req . first ) ; RecruitBlobWorkerReply rep ; rep . worker = worker . interf ; rep . processClass = worker . processClass ; req . first . reply . send ( rep ) ; swapAndPop ( & self -> outstandingBlobWorkerRequests , i -- ) ; } } catch ( Error & e ) { if ( e . code ( ) == error_code_no_more_servers ) { TraceEvent ( SevWarn , " " , self -> id ) . suppressFor ( 1.0 ) . detail ( " " , i ) . error ( e ) ; } else { TraceEvent ( SevError , " " , self -> id ) . error ( e ) ; throw ; } } } }
When workers aren't available at the time of request, the request
gets added to a list of outstanding reqs.
When workers aren ' t available at the time of request the request gets added to a list of outstanding reqs .
// can remove it once we know the worker was found