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

Improve background processing #18

Open
elia opened this issue Feb 14, 2020 · 5 comments
Open

Improve background processing #18

elia opened this issue Feb 14, 2020 · 5 comments
Labels
Milestone

Comments

@elia
Copy link
Member

elia commented Feb 14, 2020

  • Attachment processor: transfer the files in separate jobs
  • Process rows in the background to improve concurrency
  • Group the rows by common changes (ex. for products by product slug)

Originally part of the roadmap in #5

@elia elia added this to the v2.0 milestone Feb 14, 2020
@stale
Copy link

stale bot commented Jul 10, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jul 10, 2020
@elia elia removed the wontfix This will not be worked on label Jul 10, 2020
@stale
Copy link

stale bot commented Sep 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Sep 9, 2020
@stale stale bot closed this as completed Sep 17, 2020
@elia elia reopened this Sep 17, 2020
@stale stale bot removed the wontfix This will not be worked on label Sep 17, 2020
@stale
Copy link

stale bot commented Nov 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Nov 16, 2020
@stale stale bot closed this as completed Nov 23, 2020
@elia elia reopened this Nov 24, 2020
@stale stale bot removed the wontfix This will not be worked on label Nov 24, 2020
@stale
Copy link

stale bot commented Jan 23, 2021

This issue has been automatically marked as stale because it has not had recent activity. It might be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 23, 2021
@cesartalves
Copy link
Contributor

Process rows in the background to improve concurrency

This would be extremely useful given that, with long files, the background processing library (eg Sidekiq) might crash in the middle and leave unfinished rows. Since the status of the SolidusImporter::Import is left as processing, these never are processed. This has happened a few times on a client project 🥲

Not only that, the way we import Orders right now is super fragile - we import all of them in an after_import call, many times breaking without a visible error, since there's only a context[:success] = false there which provides no useful error messages whatsoever

For files with thousands of lines, we're also building a huge context hash since we need it all in memory for the after_import call.

Since we already have the rows as raw Hash data, I don't understand why we need all the rows to have the context of the import from the beginning. We only need the context from related rows.

I sketched a still early draft solution of a possible solution for both problems: https://gist.github.com/cesartalves/df919b261012499ed30dfd11a6a1a672

  • Move processing of related Rows to a Job
  • Move the after_import call of the importer to such a job (would probably need to rename this slightly, maybe to after_group_import, but since the Order importer is the only one that actually implements this, I don't see why not!)

I may write a Draft PR soon!

@cesartalves cesartalves added wip and removed wip labels Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants