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

Add retries to Resource PDF Generation #42600

Merged
merged 2 commits into from
Sep 22, 2021
Merged

Conversation

Hamms
Copy link
Contributor

@Hamms Hamms commented Sep 21, 2021

For background, we've had an intermittent issue with the Curriculum PDF generation process in which when it comes time to collate all our individual PDFs together in the rollup, GhostScript complains that it can't find all the files that we're telling it to roll up, and the PDF generation fails.

I've been able to track down the failure to specifically the title pages that we generate in the Resource rollup to differentiate the lessons within a script. Unfortunately, I have been unable to get any kind of reliable repro, much less to figure out why this is happening in the first place.

Because I know where the problem is but not why it is, and because it happens so rarely as to make further investigation difficult, I'm resorting to a retry. It's not a good solution, but it's the best I got at this point.

Links

Testing story

Deployment strategy

Follow-up work

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

For background, we've had an intermittent issue with the Curriculum PDF generation process in which when it comes time to collate all our individual PDFs together in the rollup, GhostScript complains that it can't find all the files that we're telling it to roll up, and the PDF generation fails.

I've been able to track down the failure to specifically the title pages that we generate in the Resource rollup to differentiate the lessons within a script. Unfortunately, I have been unable to get any kind of reliable repro, much less to figure out *why* this is happening in the first place.

Because I know where the problem is but not why it is, and because it happens so rarely as to make further investigation difficult, I'm resorting to a blind retry. It's not a good solution, but it's the best I got at this point.
@Hamms Hamms requested a review from a team September 21, 2021 19:51
Copy link
Member

@davidsbailey davidsbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems quite reasonable!

# Adding some logging here to help diagnose.
unless $?.success?
ChatClient.log(
"PDF generation exited with status code #{$?.exitstatus.inspect}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you get any helpful error information here? If so, can you summarize what it was before removing it?

Copy link
Contributor Author

@Hamms Hamms Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did and I didn't. This clause never triggered at any point, so in once sense I got no information, and in another sense I learned that even when we end up failing to generate a file (as indicated by the other clause triggering), the process still reports a success. So I'm removing the clause, but it is worth keeping in mind that whatever's going on here, it's subtle.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I figured, but wanted to double check. Thanks!

@Hamms Hamms merged commit b69c9c2 into staging Sep 22, 2021
@Hamms Hamms deleted the blindly-retry-pdf-generation branch September 22, 2021 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants