Reset infinite loop #809
Comments
|
As reported by @debabratakarfa here, I'm able to reset the site using the latest I can also reset it using the web interface. I'm investigating this further, but based on @swissspidy's reported setup, my hunch is that the issue stems from using an external object cache (Memcached object cache in this case). I'll try to reproduce the issue, but as that setup is a bit less typical I don't think this is a good candidate for today's hotfix release:
|
|
I just tested this with a drop-in memcache object cache as well and could still reset using both the web interface and CLI. @aaemnnosttv tested it as well (with the object-cache enabled and disabled) and it worked. So it seems we can't reproduce these results. Is there anything else special about your setup @swissspidy? I've not seen the reset failing for me and I use it a lot during development. Our E2E tests also have a reset test and use the reset functionality a lot and they're all running okay. |
|
Closing for now as unable to reproduce per @swissspidy |
|
Reopening this as it still seems to be occuring. Not relevant for 1.0.3, but we should continue to investigate. Sites using object cache are common enough to prioritize this (if that's truly the cause of the issue). |
|
@ThierryA @swissspidy Any updates on this one in terms of how to replicate? If resetting can cause an infinite loop, this might also affect the ability to delete (uninstall) the plugin. |
|
As previously mentioned I‘ll have to test again after my vacation. Since it might be specific to my setup, I am still happy with it being closed for now. |
|
Will do more testing this week. @swissspidy stop
checking your work emails during your vacation ;-)
…On Sun, Nov 17, 2019 at 10:38 PM Pascal Birchler ***@***.***> wrote:
As previously mentioned I‘ll have to test again after my vacation. Since
it might be specific to my setup, I am still happy with it being closed for
now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#809?email_source=notifications&email_token=AA3KLWQSBT2CTTCGOYSIXDDQUG2V7A5CNFSM4JKELIF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEIW2HY#issuecomment-554790175>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA3KLWWWZJZ4QFFYSHGMZULQUG2V7ANCNFSM4JKELIFQ>
.
--
[image: Google Logo]
Thierry Muller
Developer Relations Program Manager
Engineering - News & Content Ecosystem
thierrymuller@google.com
|
|
Moving this one back to AC for now until there is sufficient basis for an IB. |
|
Quickly digging more into this, it seems to be cc @felixarntz |
|
Makes sense, from the latest tests it seems that this is not an infinite loop, but simply a highly expensive process the way we're doing it now (iterating over users and doing tons of individual DB deletions). On Thierry's site this would commonly take about 30 seconds. |
|
@felix what about the following: global $wpdb;
$key = '%googlesitekit%';
// Delete options and transients.
$wpdb->query(
$wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE meta_key LIKE %s OR meta_key LIKE %s", $key, 'sitekit_authentication' )
);
// Delete user meta.
$wpdb->query(
$wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s", $key )
);The above takes care of options and transients in on query. |
|
We're already doing this in our reset utility for E2E tests (See #351). site-kit-wp/tests/e2e/plugins/reset.php Lines 25 to 36 in b524540 For production use, I think it's a bit heavy-handed to target any/all keys that contain We could potentially simplify the queries performed using
Should we not wipe both variants? |
From my quick tests it is pretty fast. If we don't do that we would have to include the |
|
My concern isn't about performance but of compatibility with other plugins/themes which could store an option/meta/transient with |
|
I see, should any plugins or themes every use that though? Let's rather be safe than sorry. Will update my draft PR shortly. |
|
QA |




Bug Description
When trying to reset Site Kit either on the setup screen or via
wp google-site-kit reset, nothing happens. It's just stuck.Steps to reproduce
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
uninstall.phpfile. This file should then include the new reset/uninstall logic (see below), with the following condition at the top:Reset::all(), set a$googlesitekit_resetvariable totrueand require theuninstall.phpfile.Reset, theuninstall.phpfile should include simple and optimized DB queries using$wpdbwhich delete the data in a more efficient way:$wpdb->query( $wpdb->prepare( "DELETE * from {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s OR option_name LIKE %s", $prefix, '_transient_' . $prefix, '_transient_timeout_' . $prefix ) )$wpdb->query( $wpdb->prepare( "DELETE * from {$wpdb->usermeta} WHERE meta_key LIKE %s", $user_prefix ) )$prefixshould begooglesitekit_%and the$user_prefixshould be$context->is_network_mode() ? $prefix : $wpdb->get_blog_prefix() . $prefix.Contextclass instance (for the above check), the file should check if the class does not exist, and if so load the file manually. It can then create an instance of it.wp_cache_flush().Changelog entry
The text was updated successfully, but these errors were encountered: