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
I'm getting a deadlock when I try to resize the window (or re-focus it, or any other action that sends a window event from the main thread to itself).
See the video for some more details, but this is the gist:
It seems like the deadlock is caused when one of my (not main) threads runs a window.emit('whatever', ...), which acquires a lock on the webview and holds it until the script has been run (I think - not 100% sure on what it waits for). Then when I resize the window, that tries to acquire a lock on the webview too, which is already locked by the emitted event. Then it just hangs forever because it can't get the lock until the main thread runs the emitted JS thing, which will never happen because it's paused waiting for the lock 🙃 That's my theory anyway.
I noticed it seemed to start happening when I added the tauri-devtools plugin. With Fabian's suggestion in Discord, I was able to create a minimal reproduction with just the tauri tracing feature enabled. I can't get it to happen when tracing is not enabled.
^ The code spawns a thread which loops and keeps emitting events to the webview
The webview on receiving the event calls an invoke command
With the tracing feature active, the main thread is stuck on acquiring the lock since the thread with tracing is still waiting for a message from the webview.
I'm experiencing something very similar when resizing while events are being emitted at a high frequency (around once every 10 ms), the app deadlocks. I'm able to work around it by using a channel instead.
I have similar symptoms just from emitting on app within a non-async command. Running an older version of Tauri, though. Don't have tracing enabled explicitly.
Describe the bug
[ moving this here from Discord ]
I'm getting a deadlock when I try to resize the window (or re-focus it, or any other action that sends a window event from the main thread to itself).
See the video for some more details, but this is the gist:
It seems like the deadlock is caused when one of my (not main) threads runs a
window.emit('whatever', ...)
, which acquires a lock on the webview and holds it until the script has been run (I think - not 100% sure on what it waits for). Then when I resize the window, that tries to acquire a lock on the webview too, which is already locked by the emitted event. Then it just hangs forever because it can't get the lock until the main thread runs the emitted JS thing, which will never happen because it's paused waiting for the lock 🙃 That's my theory anyway.I noticed it seemed to start happening when I added the tauri-devtools plugin. With Fabian's suggestion in Discord, I was able to create a minimal reproduction with just the tauri
tracing
feature enabled. I can't get it to happen whentracing
is not enabled.Fabian thought this might be related: #9429
tauri-v2-deadlock.mp4
Reproduction
https://github.com/dceddia/tauri-tracing-freeze
Expected behavior
Ideally no deadlock 😄
Full
tauri info
outputStack trace
Additional context
No response
The text was updated successfully, but these errors were encountered: