Throw 403 instead of 429 when max job capacity full (elastic/elasticsearch#445)
Closes elastic/elasticsearch#444 Original commit: elastic/x-pack-elasticsearch@dfaf8dbec4
This commit is contained in:
parent
41bd367071
commit
b6bdef474d
|
@ -123,7 +123,7 @@ public class AutodetectProcessManager extends AbstractComponent implements DataP
|
|||
AutodetectCommunicator create(String jobId, boolean ignoreDowntime) {
|
||||
if (autoDetectCommunicatorByJob.size() == maxRunningJobs) {
|
||||
throw new ElasticsearchStatusException("max running job capacity [" + maxRunningJobs + "] reached",
|
||||
RestStatus.TOO_MANY_REQUESTS);
|
||||
RestStatus.FORBIDDEN);
|
||||
}
|
||||
|
||||
// TODO norelease, once we remove black hole process
|
||||
|
|
|
@ -81,7 +81,7 @@ public class TooManyJobsIT extends ESIntegTestCase {
|
|||
logger.warn("Unexpected cause", e);
|
||||
}
|
||||
assertEquals(ElasticsearchStatusException.class, cause.getClass());
|
||||
assertEquals(RestStatus.TOO_MANY_REQUESTS, ((ElasticsearchStatusException) cause).status());
|
||||
assertEquals(RestStatus.FORBIDDEN, ((ElasticsearchStatusException) cause).status());
|
||||
logger.info("good news everybody --> reached threadpool capacity after starting {}th analytical process", i);
|
||||
|
||||
// now manually clean things up and see if we can succeed to start one new job
|
||||
|
|
Loading…
Reference in New Issue