-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Out of memory exception when export a content type that has more than 80,000 content items #11406
Comments
Would it be possible for your to share the offending export file? |
Do you mean the deployment recipe or the exported result file? If the exported file, I think it can't be. The exception was thrown before the exported file was generated. |
I follow the StrackTrace of the exception and found that in ContentDeploymentSource.cs OC loads all content to local memory before flush them to the exported zip file.
I think it makes sense why the Out-of-memory exception was thrown based on the code snippet which I capture from ProcessDeploymentStepAsync method. The memory would run out eventually if the exporting list is large enough. |
Sorry, I misinterpreted this being an issue with import... Yeah, of course you can't share the export file then. This indeed looks like a risky code. Would you venture into fixing it in a pull request? |
I don't know. Seems maybe a stream object can help on this. But as I see, for now, it looks like a little hard to pass a stream out from a DeloymentSource to an upper caller. |
Would need to be done in batches of lower size, each batch being processed in an isolated shell scope (we have helpers for this) that will commit its own transaction on disposing. |
What if the actual batches fail in the middle of the process. Maybe it would be worth investing time in making this more robust. |
Yes, I thought about that, was just for info, in fact related to custom imports (not exports but still with batches) we do from old databases. In our case if it fails we have UI notifications and logged errors. Then on a new try, items already imported are not processed again (idempotency). |
The solution is to follow the TODO here: https://github.com/OrchardCMS/OrchardCore/blob/main/src/OrchardCore.Modules/OrchardCore.Contents/Deployment/ContentDeploymentSource.cs#L22 Batch the query, and create a separate file for each batch, with a step that links to the file. |
There is also a problem when trying to execute a large recipe file. The request times out. batching the request may solve the timeout issue too. |
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues). This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here. |
Describe the bug
When use remote deployment feature and deployment a recipe that export the content items of a content type than import those items to a remote instance. The Out-of-memory exception is thrown.
Expected behavior
The remote deployment can be finish with succeed.
Screenshots
If applicable, add screenshots to help explain your problem.
N/A
The text was updated successfully, but these errors were encountered: