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
Sync Manager: Support for sync interruption #1684
Comments
I'm going to try to fix this one alongside #4617 |
Talked with mhammond about this one some more and I think fixing it is a bigger project. I think we can probably do it along side the sync-manager/places work we're doing, but not with #4617. |
- Changed the bookmarks/history sync engines to use an Arc<Mutex<PlacesDb>>, which matches the other engines better - Made these sync engines create their own `SqlInterruptScope`. The interrupt code is still not working, but I think this is the direction we want to go for mozilla#1684. If not, it should be easy to replace. - Removed the old `PlacesApi.open_sync_connection()` method and replaced it with the new `get_sync_connection()` method - Lots of unit test updates. I didn't take the time to understand these fully. I just made changes until it compiled, didn't deadlock, and passed.
- Changed the bookmarks/history sync engines to use an Arc<Mutex<PlacesDb>>, which matches the other engines better - Made these sync engines create their own `SqlInterruptScope`. The interrupt code is still not working, but I think this is the direction we want to go for mozilla#1684. If not, it should be easy to replace. - Updated the `PlacesApi` syncing code to use the new sync engines. One thing to note here is that the SyncManager has its own system of managing the global state, so the fact that those methods update it outside of the Mutex lock that the `SyncEngine` takes is not a problem. - Updated the importer code to use the new `get_sync_connection()` method. The only difference here is that the importer code needs to lock the mutex, this replaces the old system where `open_sync_connection()` would return an error if a previously returned connection was still alive. - Removed the old `PlacesApi.open_sync_connection()` method and replaced it with the new `get_sync_connection()` method - Lots of unit test updates. I didn't take the time to understand these fully. I just made changes until it compiled, didn't deadlock, and passed.
- Changed the bookmarks/history sync engines to use an Arc<Mutex<PlacesDb>>, which matches the other engines better - Made these sync engines create their own `SqlInterruptScope`. The interrupt code is still not working, but I think this is the direction we want to go for mozilla#1684. If not, it should be easy to replace. - Updated the `PlacesApi` syncing code to use the new sync engines. One thing to note here is that the SyncManager has its own system of managing the global state, so the fact that those methods update it outside of the Mutex lock that the `SyncEngine` takes is not a problem. - Updated the importer code to use the new `get_sync_connection()` method. The only difference here is that the importer code needs to lock the mutex, this replaces the old system where `open_sync_connection()` would return an error if a previously returned connection was still alive. - Removed the old `PlacesApi.open_sync_connection()` method and replaced it with the new `get_sync_connection()` method - Lots of unit test updates. I didn't take the time to understand these fully. I just made changes until it compiled, didn't deadlock, and passed.
- Changed the bookmarks/history sync engines to use an Arc<Mutex<PlacesDb>>, which matches the other engines better - Made these sync engines create their own `SqlInterruptScope`. The interrupt code is still not working, but I think this is the direction we want to go for mozilla#1684. If not, it should be easy to replace. - Updated the `PlacesApi` syncing code to use the new sync engines. One thing to note here is that the SyncManager has its own system of managing the global state, so the fact that those methods update it outside of the Mutex lock that the `SyncEngine` takes is not a problem. - Updated the importer code to use the new `get_sync_connection()` method. The only difference here is that the importer code needs to lock the mutex, this replaces the old system where `open_sync_connection()` would return an error if a previously returned connection was still alive. - Removed the old `PlacesApi.open_sync_connection()` method and replaced it with the new `get_sync_connection()` method - Lots of unit test updates. I didn't take the time to understand these fully. I just made changes until it compiled, didn't deadlock, and passed.
- Changed the bookmarks/history sync engines to use an Arc<Mutex<PlacesDb>>, which matches the other engines better - Made these sync engines create their own `SqlInterruptScope`. The interrupt code is still not working, but I think this is the direction we want to go for mozilla#1684. If not, it should be easy to replace. - Updated the `PlacesApi` syncing code to use the new sync engines. One thing to note here is that the SyncManager has its own system of managing the global state, so the fact that those methods update it outside of the Mutex lock that the `SyncEngine` takes is not a problem. - Updated the importer code to use the new `get_sync_connection()` method. The only difference here is that the importer code needs to lock the mutex, this replaces the old system where `open_sync_connection()` would return an error if a previously returned connection was still alive. - Removed the old `PlacesApi.open_sync_connection()` method and replaced it with the new `get_sync_connection()` method - Lots of unit test updates. I didn't take the time to understand these fully. I just made changes until it compiled, didn't deadlock, and passed.
- Changed the bookmarks/history sync engines to use an Arc<Mutex<PlacesDb>>, which matches the other engines better - Made these sync engines create their own `SqlInterruptScope`. The interrupt code is still not working, but I think this is the direction we want to go for #1684. If not, it should be easy to replace. - Updated the `PlacesApi` syncing code to use the new sync engines. One thing to note here is that the SyncManager has its own system of managing the global state, so the fact that those methods update it outside of the Mutex lock that the `SyncEngine` takes is not a problem. - Updated the importer code to use the new `get_sync_connection()` method. The only difference here is that the importer code needs to lock the mutex, this replaces the old system where `open_sync_connection()` would return an error if a previously returned connection was still alive. - Removed the old `PlacesApi.open_sync_connection()` method and replaced it with the new `get_sync_connection()` method - Lots of unit test updates. I didn't take the time to understand these fully. I just made changes until it compiled, didn't deadlock, and passed.
This one has been tricky for 2 reasons:
I think there is a way forward on this one though:
I think this makes this issue much more tractable since we can ignore the harder issue of trying to interrupt a sql query for components with a shared DB connection |
Can we just add an But in general, this SGTM. |
I didn't add At some point, we could define a |
Ignore those last few comments, we decided to go a different way with this one. #4816 adds some support for this by adding a shutdown module in sql-support that allows the consumer code to enter shutdown mode which permanently interrupts all There's still a few items left to do though:
|
In #1447, I punted on interruption, mainly as it's hard to make logins/places use the correct interrupt handle (Instead, I gave them a dummy interrupt handle). This is probably a problem long term, as sync (probably) needs to be interruptable.
┆Issue is synchronized with this Jira Task
┆Epic: Sync Ecosystem (backlog)
┆Sprint End Date: 2022-02-03
The text was updated successfully, but these errors were encountered: