-
Notifications
You must be signed in to change notification settings - Fork 820
Full sync: Ensure actions are processed in wpcom before marking modules as finished #43229
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
Full sync: Ensure actions are processed in wpcom before marking modules as finished #43229
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 6 files. Only the first 5 are listed here.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how reliable my review will be as my testing was inconsistent so I'll add this as a review comment instead.
I added the exception within a few places in WPcom to be sure it will generate the exception (eg. in process_event
in jetpack/sync/class.jetpack-sync-event-processor.php
, in maybe_perform_sync_pull
in jetpack/sync/class.jetpack-sync-shadow-replicastore.php
, in handle_remote_action
in jetpack/sync/class.jetpack-sync-server-replicator.php
) - only once it did not run anything, then continued after removing the code, another time it skipped constants and ran functions and options, then stopped, continuing when the code was removed.
Either way I realize it was an attempt to mimic WPcom slowing things down, and I can see that the full sync was stopping until the 'block' was removed, so in that respect it looks like it tests well.
Total sync actions in status column looks good!
Thanks for reviewing @coder-karen! Yeah, sorry I was not very explicit with the sabotaging. I was referring to the first scenario you mentioned, in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying :) I tested more, tests as expected.
it should run any module that is sent prior to Constants and then stop there and not continue.
Noting that we discussed that in Slack, and the order in which modules show in the debugger doesn't necessarily match the order in which they're sent (hence constants appearing to be skipped and the two following modules showing as synced), so by getting that result in testing that was expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Related to VULCAN-74
The Full Sync modules that don't use chunking and override the send_full_sync_actions method don't wait for a response when sending the full sync actions to be processed by wpcom. Example with updates.
This can create issues since the remote site continues the Full Sync without actually processing the items. The most common issue will be when in wpcom we detect concurrent requests (maybe due to a pull or some other reason).
Proposed changes:
WP_Error
) and not mark the module as finished if it has not.sent
key too.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
No
Testing instructions:
Test that normal Full Sync works as expected
Run Full Sync not processing a non chunked module
The above in trunk will not stop the full sync progress, but the
jetpack_full_sync_constants
action would not have been processed.Check that now we get total Sync actions sent after in Debugger for non-chunked modules
All sent
, while now it will present the number of items synced42 out of 42 sent
.