mirror of https://gitee.com/bigwinds/arangodb
respond with proper error message in case queue is full
This commit is contained in:
parent
d1adb02fa6
commit
e2d0f4342f
|
@ -149,6 +149,7 @@ bool GeneralServer::handleRequestAsync(GeneralCommTask* task,
|
||||||
if (res != TRI_ERROR_DISPATCHER_IS_STOPPING) {
|
if (res != TRI_ERROR_DISPATCHER_IS_STOPPING) {
|
||||||
LOG(WARN) << "unable to add job to the job queue: "
|
LOG(WARN) << "unable to add job to the job queue: "
|
||||||
<< TRI_errno_string(res);
|
<< TRI_errno_string(res);
|
||||||
|
task->handleSimpleError(rest::ResponseCode::SERVICE_UNAVAILABLE, res, TRI_errno_string(res), messageId);
|
||||||
} else {
|
} else {
|
||||||
task->handleSimpleError(rest::ResponseCode::SERVICE_UNAVAILABLE, messageId);
|
task->handleSimpleError(rest::ResponseCode::SERVICE_UNAVAILABLE, messageId);
|
||||||
return true;
|
return true;
|
||||||
|
@ -189,8 +190,8 @@ bool GeneralServer::handleRequest(GeneralCommTask* task,
|
||||||
// add the job to the dispatcher
|
// add the job to the dispatcher
|
||||||
int res = DispatcherFeature::DISPATCHER->addJob(job, startThread);
|
int res = DispatcherFeature::DISPATCHER->addJob(job, startThread);
|
||||||
|
|
||||||
if (res == TRI_ERROR_DISPATCHER_IS_STOPPING) {
|
if (res != TRI_ERROR_NO_ERROR) {
|
||||||
task->handleSimpleError(rest::ResponseCode::SERVICE_UNAVAILABLE, messageId);
|
task->handleSimpleError(rest::ResponseCode::SERVICE_UNAVAILABLE, res, TRI_errno_string(res), messageId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue