Skip to content

Stopping a reindex in its first seconds is ignored and leaves the run stuck as Running #35182

Description

@manerow

Problem

If someone stops the Search Indexing application in the first few seconds of a run, while the reindex is still being set up, the stop is not honored:

  • The reindex still runs. A few seconds after the stop, the server picks the job up again and indexes everything the user asked to stop.
  • The run's status goes back to Running and never reaches a final state. It shows as Running until the next reindex starts.

In Collate, Admin Ops treats a Running app as busy. So after this happens, every new reindex request is refused with a 409, and the Admin Ops job that tracked the stopped run stays Running for up to an hour. This is what has kept Collate CI red on main since 9 October (AdminOpsApiIT.testCancelReindexJobMarksFailed and testReindexJobEndsWhenItsRunIsStopped).

Expected behaviour

A stop is honored however early it arrives: nothing is indexed after it, and the run ends as Stopped.

Acceptance criteria

  • Stopping a run during its setup ends it as Stopped, and it stays Stopped.
  • No entity is indexed for that run after the stop.
  • A new reindex can be started right after.

How to reproduce

Trigger SearchIndexingApplication, then call POST /v1/apps/stop/SearchIndexingApplication about one second later, before Reindexing job started appears in the server log. GET /v1/apps/name/SearchIndexingApplication/runs/latest shows stopped briefly, then running, and never ends. The server log shows Restored appRunRecord to running a few seconds after the stop.

Seen in Collate CI runs 37938923627 and 38031946718.

Activity

  1. added theissue type on Oct 10, 2026
  2. added this to Shipping and removed this from Roadmapon Oct 10, 2026
  3. moved this from In Progress 🏗️ to In Review / QA 👀 in Shippingon Oct 10, 2026
  4. moved this from In Review / QA 👀 to Done ✅ in Shippingon Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

  • Status
    Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions