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

fix: wait for all streams to close when writing backups #5835

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

rneatherway
Copy link
Contributor

@rneatherway rneatherway commented Feb 23, 2024

Description

Without these changes I would often receive Error: Archiving backup failed: Size mismatch when using sanity backup download. I would also sometimes instead find that the tarball was successfully created but contained truncated files.

What to review

My use of streams - I do not have much experience with them. I am not sure if the changes to the docOutStream are necessary.

Testing

I tested this with a script that:

  1. runs sanity backup download
  2. if that succeeds, untars the export-format tarball and checks the sha1sum of all images against their filenames

I then ran this script in a loop. Before the change it rarely succeeded. After the change it has run for hundreds of iterations in a row without failing.

Notes for release

None needed, this feature is not yet formally released.

@rneatherway rneatherway requested a review from a team as a code owner February 23, 2024 19:27
@rneatherway rneatherway requested review from binoy14 and removed request for a team February 23, 2024 19:27
Copy link

vercel bot commented Feb 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
performance-studio ✅ Ready (Inspect) Visit Preview Feb 26, 2024 3:17pm
test-studio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2024 3:17pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
studio-workshop ⬜️ Ignored (Inspect) Visit Preview Feb 26, 2024 3:17pm

Copy link
Contributor

No changes to documentation

Copy link
Contributor

github-actions bot commented Feb 23, 2024

Component Testing Report Updated Feb 26, 2024 3:22 PM (UTC)

File Status Duration Passed Skipped Failed
comments/CommentInput.spec.tsx ✅ Passed (Inspect) 33s 15 0 0
formBuilder/ArrayInput.spec.tsx ✅ Passed (Inspect) 6s 3 0 0
formBuilder/inputs/PortableText/Annotations.spec.tsx ✅ Passed (Inspect) 13s 3 0 0
formBuilder/inputs/PortableText/copyPaste/CopyPaste.spec.tsx ✅ Passed (Inspect) 12s 4 2 0
formBuilder/inputs/PortableText/Decorators.spec.tsx ✅ Passed (Inspect) 12s 6 0 0
formBuilder/inputs/PortableText/FocusTracking.spec.tsx ✅ Passed (Inspect) 33s 15 0 0
formBuilder/inputs/PortableText/Input.spec.tsx ✅ Passed (Inspect) 1m 2s 15 0 0
formBuilder/inputs/PortableText/ObjectBlock.spec.tsx ✅ Passed (Inspect) 1m 3s 18 0 0
formBuilder/inputs/PortableText/Styles.spec.tsx ✅ Passed (Inspect) 13s 6 0 0
formBuilder/inputs/PortableText/Toolbar.spec.tsx ✅ Passed (Inspect) 20s 9 0 0

Copy link
Contributor

@j33ty j33ty left a comment

Choose a reason for hiding this comment

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

Interesting, good find. Thank you for taking it up. I must say I am not much familiar with Node streams either and would love a re-review from Studio team.

Copy link
Contributor

@binoy14 binoy14 left a comment

Choose a reason for hiding this comment

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

Not familiar with this pipeline API but given this feature is not formally release and there is a task to add tests for this happy to approve it since quick glance at the docs it does what is expected

@rneatherway rneatherway added this pull request to the merge queue Feb 26, 2024
Merged via the queue into next with commit 0363599 Feb 26, 2024
39 of 40 checks passed
@rneatherway rneatherway deleted the fix/backup-streams branch February 26, 2024 15:45
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.

3 participants