Description
Tested versions
- Master (anything after 2d1dd41)
- 4.4 dev2 (does not reproduce)
System information
Godot v4.4.dev (2d1dd41) - Pop!_OS 22.04 LTS - X11 - Vulkan (Forward+) - integrated Intel(R) Xe Graphics (TGL GT2) - 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz (8 Threads)
Issue description
The WorkerThreadPool deadlocks in the main::cleanup()
function during shutdown.
This is a regression and I bisected it to 2d1dd41
#96760 makes it so the WTP is finalized before the servers have a chance to shut down. When using the MT thread model, the servers yield to the WTP until a command is pushed to them.
During finalizing, the WTP waits for all threads to finish, this locks the main thread. However, the command to finalize the rendering thread happens after the WTP finalizes. So the main thread gets stuck indefinitely.
This bug also impacts any other system that creates a long running thread through the WTP and relies on yielding.
Steps to reproduce
- Enabled the Multi thread rendering model
- Run the project
- Try to close the project
Minimal reproduction project (MRP)
Metadata
Metadata
Assignees
Type
Projects
Status
Immediate Blocker