You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are upgrading our Kotlin language binding to Godot 4.3, but the engine doesn't want to close anymore.
Before our embedded JVM can close, it waits for all "attached" threads to be closed.
We usually attach/detach threads to the JVM using the callback ScriptServer::thread_enter / ScriptServer::thread_exit.
It seems that a recent change to WorkerThreadPool makes all threads call ScriptServer::thread_enter (in a delayed manner because the pool is initialized before the ScriptServer). The issue seems to be that ScriptServer::thread_exit is never called by it before the ScriptServer is terminated. Instead, it only happens when the pool threads are deleted as part of the WorkerThreadPool's destructor, which happens in the very last steps of Main::cleanup.
I also can't find any callbacks that would be executed this late either (MessageQueue is freed before the pool as well).
I'm not certain that this is the source of our issue but we confirmed that we received more thread_enter calls than thread_exit calls. So it's either the pool, or some mysterious other thread somewhere in Godot that is not terminated in time.
Tested versions
Godot 4.3 stable
System information
Windows 10
Issue description
We are upgrading our Kotlin language binding to Godot 4.3, but the engine doesn't want to close anymore.
Before our embedded JVM can close, it waits for all "attached" threads to be closed.
We usually attach/detach threads to the JVM using the callback
ScriptServer::thread_enter
/ScriptServer::thread_exit
.It seems that a recent change to
WorkerThreadPool
makes all threads callScriptServer::thread_enter
(in a delayed manner because the pool is initialized before theScriptServer
). The issue seems to be thatScriptServer::thread_exit
is never called by it before theScriptServer
is terminated. Instead, it only happens when the pool threads are deleted as part of the WorkerThreadPool's destructor, which happens in the very last steps ofMain::cleanup
.I also can't find any callbacks that would be executed this late either (
MessageQueue
is freed before the pool as well).I'm not certain that this is the source of our issue but we confirmed that we received more
thread_enter
calls thanthread_exit
calls. So it's either the pool, or some mysterious other thread somewhere in Godot that is not terminated in time.@RandomShaper
Steps to reproduce
Minimal reproduction project (MRP)
The text was updated successfully, but these errors were encountered: