-
-
Notifications
You must be signed in to change notification settings - Fork 114
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
Two locations in the core engine synchronously block on async operations, violating the project's "NEVER block on async" principle.
Location 1: EngineCancellationToken.cs (Line 87)
Task.Delay(TimeSpan.FromMilliseconds(500)).GetAwaiter().GetResult();This is in the ProcessExit event handler, which runs on a background thread with limited time (~3 seconds on Windows). Blocking on async here is a deadlock risk and can prevent After hooks from completing.
Location 2: DedicatedThreadExecutor.cs (Line 365)
waitTask.GetAwaiter().GetResult();Synchronous blocking on an async task in a dedicated thread executor. Although the comment suggests it's safe, this blocks the thread unnecessarily and prevents responsive message pump processing.
Suggested Fix
Location 1: Register async callbacks using CancellationToken.Register() instead of blocking.
Location 2: Return a ValueTask that awaits the task: return new ValueTask(waitTask);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working