-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] plugin_websocket: When WebSocket accepts a large number of concurrent messages, multiple clone windows may cause crashes #2186
Comments
I assume this is tauri-apps/tauri#8177 actually and not the window.clone() line. Unless of course you have a panic message for us that tells us more? |
@FabianLars
I don't think it's caused by this problem. Because I try to get let window_arc = Arc::new(Mutex::new(window));
read.for_each(move |message| {
let window_ = Arc::clone(&window_arc);
// ...
}) The program crashes directly without panic, so we can only try to catch the exception through Windows'
|
@FabianLars The previous crash was because one of our functions was called multiple times concurrently. It is very simple to reproduce this problem. The approximate code is as follows: function clickFn() {
appWindow.unminimize();
appWindow.show();
appWindow.setFocus();
}
setInterval(() => clickFn(), 10);
setInterval(() => clickFn(), 100); After running the program, wait for 1-5 minutes and it will crash. Of course, this is a problem with our code, but it will occasionally trigger a crash, and the crash log is similar. Later, we modified this part of the code so that concurrent calls would not occur and the crash would disappear. These are some problems we have encountered recently. I suspect it has nothing to do with |
Because I have also tested a large number of Maybe after operating the window, we need to This is what we have discovered through extensive experiments, and if you need us to provide some other examples, we will be happy to provide them. Thanks alot! |
The code in question is here:
https://github.com/tauri-apps/tauri-plugin-websocket/blob/dev/src/lib.rs#L96
This problem is inevitable in my local testing: once there are a large number of ws messages, the application will crash. The problem currently located is caused by this.
The text was updated successfully, but these errors were encountered: