-
Notifications
You must be signed in to change notification settings - Fork 165
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
Paused sessions seem to keep the Realm open #6372
Comments
➤ Jonathan Reams commented: I think I see what's up here. I'm just trying to come up with a good test for it. |
@nirinchev , I think I've got a fix up in PR #6383 and I've got a test that checks that the ref count on the DBRef is correct, but could you check to see this fixes the issue of being able to remove the file as well, since I think that may be a more platform-specific issue? |
Sure, I've been distracted with some metrics tests, but will try to do it later today. |
I can confirm that the changes in #6383 make the .NET test pass consistently 🎉 |
I have the following test that fails consistently:
The error being thrown is
Cannot delete files of an open Realm
. I haven't been able to pinpoint the issue, but what I'm seeing is:SyncSession::pause()
which in turn callsSyncSession::do_become_inactive
.m_sync_manager->unregister_session
, we get intoauto existing_session = it->second->existing_external_reference()
, which unlocks the lock, but doesn't remove the session from the map because someone is holding a reference to the session (this is the SDK).realm.Dispose
that also closes the managed session, which goes intoSyncSession::ExternalReference::~ExternalReference
.SyncSession::did_drop_external_reference
callsSyncSession::close
, but because we're inPaused
state, we unlock the state mutex without unregistering the session from the sync manager.I'm not sure if the sync client does anything special about paused sessions, but it doesn't appear like it's closing the Realm, which then prevents the deletion.
The text was updated successfully, but these errors were encountered: