-
Notifications
You must be signed in to change notification settings - Fork 586
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
Process keep hanging after electron app is closed (Windows) #6357
Comments
@rossicler-hostalky Thank you for reporting. I believe that the upgrade to Realm Core v13.9.0 in Realm JS v11.7.0 could be the issue. Please try to upgrade to v11.8.0. |
@kneth Thanks for replying. I tried updating realm to v11.8.0 and also v11.10.2 and no success. Any idea of what else can I do to get this sorted? |
I did try I will take a look at |
I ran my electron app with With:
Without:
Now, going to
|
@kneth sorry to ping you again, but any updates regarding this issue? |
@rossicler-hostalky Unfortunately not but your observation is interesting. We need to investigate it a bit more. Update: #6393 might be related. |
@kneth I see, if there's anything more I can to help get this sorted faster, please let me know. |
@rossicler-hostalky I'll bring the issue up at next team meeting |
Unfortunately we haven't been able to find a solution yet. Our current hypothesis is that a Realm Core object is preventing the garbage collector to remove an JavaScript object. |
Certainly: When that gets merged, we'll be using an The first won't prevent a Node.js process from exiting, while the other would - this can be observed through the difference in:
If this is indeed the only thing holding your process alive, that should solve it. We do however observe other issues, as @kneth referred to in his comment. I've been experimenting in #6354 but I don't believe I've reached a solution that truly solves the issue for the average user. |
@kraenhansen got it, I'll wait for that to be merged and to test if it's enough for my case. The problem I'm having with this is related to |
Realm Studio is calling quitAndInstall here: src/main/Updater.ts#L245. |
@kraenhansen I'm already calling |
Are you passing |
I wasn't before, I did this change according to how it is being done in Realm Studio, but instead of getting an error when trying to install, it seems like it can't reopen the app after this is called. I followed the process on my task manager, and I see the installer is running on silent mode, but that process closes and the app doesn't open, but that process is still running (realm process). My guess is that the same way it was giving me an error without running install in silent mode, it can't finish installing because of that process, so it just closes without finishing. |
electron-userland/electron-builder#7294 discuss some of the same issues. The Plugin is a rather radical approach. |
Thanks for sharing. Although it has some similarities, in my case it's somewhat the opposite, and I could't find a solution in there. EDIT: I found a way to kill the hanging process before installing the update by using |
@rossicler-hostalky Thank you for sharing the electron issue here, and we will follow it. |
Looks like we have a workaround now and even though there's no clear resolution on the electrong-builder issue, we should be able to close this one. |
This is not a usable solution, creates issues when auto upgrading the application as it creates a race condition between old and new instances. |
I'm not sure what that race condition is - the discussion on this issue points to the author having found a solution that works for them. They haven't mentioned race conditions, so if you're experiencing them, you're probably doing something different and you should file a new issue that describes your problem. If you have a repro case, please be sure to include that as that'll help us with the investigation. |
This thread is recommending that we implement a script that does a task kill in the installer for electron. That is not really a solution. The issue that I have is that as the old version of the application transitions to the new version, this solution as referenced sometimes works, and other times it does not work. When it does not work, the task kill command indiscriminately kills both the new and the old version, causing the application upgrade to fail the upgrade. What I think everyone is asking for, is a way for us to be able to cleanly shut down realm while synced using the API of the driver that you are providing. Currently we are using the close method and that method is creating this issue. While I could create a new ticket, there is a flaw with how the driver and realm works that needs to be solved. I would be essentially using the exact same scenario described above. |
What you're suggesting is tracked in #4535. |
With v12.7.0 we have introduced the method Realm.shutdown() to gracefully terminate Realm |
How frequently does the bug occur?
Always
Description
After closing a realm connection, I expect that realm kills all processes related to Realm, but instead there's always one process that keeps hanging on Windows. This doesn't seem happen on MacOS, just Windows.
Stacktrace & log output
No response
Can you reproduce the bug?
Always
Reproduction Steps
release/app
and runyarn install realm
.Example code:
After the above code runs and you close the app, there will be one process from the app still running. If I don't call the function
openRealm
, all processes are closed.I also tested without using sync, and for that everything works fine, so I'm guessing it's something related to syncSession. Example:
This code works as expected, no process hangs after app is closed.
Version
11.7.0
What services are you using?
Atlas Device Sync
Are you using encryption?
Yes
Platform OS and version(s)
Windows 10 Pro 22H2
Build environment
Which debugger for React Native: ..
Cocoapods version
No response
The text was updated successfully, but these errors were encountered: