Skip to content

fix(index): editor-exit deadlock — stop-aware waits on every game-thread dispatch - #134

Open
whalemenace wants to merge 1 commit into
tumourlove:masterfrom
whalemenace:fix/index-shutdown-deadlock
Open

fix(index): editor-exit deadlock — stop-aware waits on every game-thread dispatch#134
whalemenace wants to merge 1 commit into
tumourlove:masterfrom
whalemenace:fix/index-shutdown-deadlock

Conversation

@whalemenace

Copy link
Copy Markdown

Repro: fresh install, let the first full index start, QUIT_EDITOR. You get "Indexing was still in progress during shutdown — force-stopped", DDC maintenance completes, then the process hangs forever — window gone, log stalled, kill required.

It's a cross-thread deadlock. The indexing worker parks in unbounded Event->Wait()s at fourteen sites, every one waiting on work only the game thread can run (throttle/critical/periodic GC via AsyncTask(GameThread), and every FMonolithCompilerSafeDispatch batch/sentinel dispatch, which needs a game-thread tick). Meanwhile Deinitialize() blocks the game thread in WaitForCompletion(). Neither side can ever proceed.

Changes:

  • FIndexingTask::WaitForGameThreadEvent: all fourteen waits poll in 100ms slices and bail only when stop is requested AND IsEngineExitRequested() — a plain user cancel still waits normally, because the game thread is alive and will serve the task. Abandoned pooled events are deliberately leaked (a later Trigger on a leaked event is harmless; on a recycled one it's corruption).
  • FMonolithCompilerSafeDispatch gains an opt-out abort token: an abandoned dispatch's Work payload — whose captures reference the unwound worker stack — is never invoked; the ticker triggers the event and unregisters.
  • The registry-scan AsyncTask now owns its state via shared pointer instead of capturing the worker stack, so abandoning it is safe too.
  • Deinitialize completes the still-Pending TaskNotification before destroying it. This assert (FSlateNotificationManager::ShutdownOnPreExit: "Missing call to SetComplete?") was always reachable on the force-stop path — the deadlock just hung the editor before it could fire.

Verified on 0.22.0: monolith_reindex force=true, quit mid-pass — the "force-stopped" warning fires and the editor exits in under 5 seconds, zero crash artifacts. Before the patch this hung 8+ minutes until killed.

…ead dispatch, dispatcher abort token, complete the task notification on the abort path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants