fix(index): editor-exit deadlock — stop-aware waits on every game-thread dispatch - #134
Open
whalemenace wants to merge 1 commit into
Open
fix(index): editor-exit deadlock — stop-aware waits on every game-thread dispatch#134whalemenace wants to merge 1 commit into
whalemenace wants to merge 1 commit into
Conversation
…ead dispatch, dispatcher abort token, complete the task notification on the abort path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 viaAsyncTask(GameThread), and everyFMonolithCompilerSafeDispatchbatch/sentinel dispatch, which needs a game-thread tick). MeanwhileDeinitialize()blocks the game thread inWaitForCompletion(). Neither side can ever proceed.Changes:
FIndexingTask::WaitForGameThreadEvent: all fourteen waits poll in 100ms slices and bail only when stop is requested ANDIsEngineExitRequested()— 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 laterTriggeron a leaked event is harmless; on a recycled one it's corruption).FMonolithCompilerSafeDispatchgains 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.Deinitializecompletes the still-PendingTaskNotificationbefore 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.