Skip to content
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

BUG: Stuck WP-CLI sync generates a repeated output in the Sync Page #2737

Closed
felipeelia opened this issue May 3, 2022 · 0 comments · Fixed by #2748
Closed

BUG: Stuck WP-CLI sync generates a repeated output in the Sync Page #2737

felipeelia opened this issue May 3, 2022 · 0 comments · Fixed by #2748
Assignees
Labels
bug Something isn't working module:sync Issues related to the Sync functionality module:wp-cli Issues related to the WP-CLI commands
Milestone

Comments

@felipeelia
Copy link
Member

felipeelia commented May 3, 2022

Describe the bug

Currently, if a WP-CLI sync process gets killed without clearing the index meta option, any visit to the Sync Page will output the same message over and over again, wrongly suggesting that the index is still running. That happens because the Sync page does not communicate directly to the WP-CLI PHP process but rather reads from an option stored in the database.

Steps to Reproduce
2. Run php -d max_execution_time=1 "$(which wp)" elasticpress index --per-page=2 so it times out
3. Visit the Sync Page
4. Click on "Show Log"
5. See the same message being outputted
6. Run wp elasticpress clear-index
7. See the sync page stopping to output the error

Expected behavior
Ideally, the plugin:

  • Would not output the same message several times. The second and following times it'd update the same message it could say "Still processing (X seconds)", for example.
  • WP-CLI sync wouldn't be stuck. Initial tests with a code like the following clear the index every time the process ends (even if timing out):
register_shutdown_function( array( $this, 'clear_index' ) );

We have to improve it though, as we want to tell the admin user that the last sync process actually failed.

@felipeelia felipeelia added bug Something isn't working module:sync Issues related to the Sync functionality module:wp-cli Issues related to the WP-CLI commands labels May 3, 2022
@felipeelia felipeelia added this to the 4.2.0 milestone May 3, 2022
@felipeelia felipeelia self-assigned this May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module:sync Issues related to the Sync functionality module:wp-cli Issues related to the WP-CLI commands
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant