-
Notifications
You must be signed in to change notification settings - Fork 20
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
Studio: Increase timeout in wp-cli-process and terminate database import on timeout #741
base: trunk
Are you sure you want to change the base?
Conversation
I tried both |
@katinthehatsite altough it makes sense to increase the timeout, should we also ensure that when timeout is reached, the action that experiences it fails? It seems to be related or similar to #544 where the import process fails in Studio, but the database import continues running in the background. |
Thanks for the review @wojtekn ! I added some handling for that and updated testing steps. Let me know what you think |
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.
The code change looks correct. It kills the process and informs user about failed import when timeout is reached.
However, three minutes is still low as database dumps can take minutes to import. In my case, it couldn't import linked site's database within three minutes.
Let's go with 5 minutes for now, and later, we should benchmark it to see what should be the reasonable limit that allows importing bigger sites.
Cool, sounds good. The timeframe of 3 minutes worked for me but I was not sure what would be the optimal amount for different environments where users might run Studio. I will adjust to five minutes 👍 |
@wojtekn I made suggested changes. Let me know what you think |
Related issues
Closes https://github.com/Automattic/dotcom-forge/issues/10032
Proposed Changes
This PR increases the timeout for the
wp-cli-process
so that the database import does not fail for larger sites.Some related details:
Warning during import of /var/folders/bj/1qgxs1qd6_z20tw9llkw842h0000gn/T/studio_backupsJr1QS/sql/wp_aiowps_events.sql: error when executing wp-cli command
.wp_aiowps_
that have the same configuration, I noticed thatwp_aiowps_events.sql
is substantially larger.wp-cli-process
so that the larger .sql files get processed without failing.Testing Instructions
To test the fix for importing larger .sql files
Create backup link
and download it after)npm install && npm start
To test the fix for terminating database import process when it fails:
Create backup link
and download it after)npm install && npm start
Activity Monitor
app on macOSCPU
tab (see screenshot for reference of what to look for):OK
once you see the errorActivity Monitor
and confirm that CPU usage is dropped back down to initial state before import (approximately)Pre-merge Checklist