should retry when failed to pause realtime task (#11515)

This commit is contained in:
kaijianding 2023-03-25 21:33:13 +08:00 committed by GitHub
parent 19db32d6b4
commit 13ffeb50ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1770,7 +1770,7 @@ public abstract class SeekableStreamIndexTaskRunner<PartitionIdType, SequenceOff
/**
* Signals the ingestion loop to pause.
*
* @return one of the following Responses: 400 Bad Request if the task has started publishing; 202 Accepted if the
* @return one of the following Responses: 409 Bad Request if the task has started publishing; 202 Accepted if the
* method has timed out and returned before the task has paused; 200 OK with a map of the current partition sequences
* in the response body if the task successfully paused
*/
@ -1789,7 +1789,7 @@ public abstract class SeekableStreamIndexTaskRunner<PartitionIdType, SequenceOff
public Response pause() throws InterruptedException
{
if (!(status == Status.PAUSED || status == Status.READING)) {
return Response.status(Response.Status.BAD_REQUEST)
return Response.status(Response.Status.CONFLICT)
.type(MediaType.TEXT_PLAIN)
.entity(StringUtils.format("Can't pause, task is not in a pausable state (state: [%s])", status))
.build();