Skip to content

Conversation

@firefoxNX
Copy link
Contributor

@firefoxNX firefoxNX commented Jul 5, 2025

This pull request enhances the MongoBinaryDownload class in packages/mongodb-memory-server-core/src/util/MongoBinaryDownload.ts by introducing retry logic for downloads, improving error handling. These changes aim to make the file download process more robust and resilient to network issues.

Note - Earlier version of this PR had "timer to detect network stall" but in my testing that did not work so had to remove it.

Enhancements to download functionality:

  • Retry mechanism for downloads: Added support for retrying failed downloads with exponential backoff, controlled by the new maxRetries and baseDelay parameters. [1] [2]

Improvements to error handling:

  • Improved error reporting: Enhanced error messages for failed downloads and added handling for request timeouts.

Code quality updates:

  • Fixed typos and logging improvements: Corrected typos in comments and log messages (e.g., "content-lenght" to "content-length") for better readability. [1] [2]

fixes #929

Copy link
Member

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

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

Aside from the weird gitignore changes, this looks pretty OK.
Please drop the commit that adds the changes to gitignore and resulting file inclusions.

Comment on lines +39 to +40
#lib
#packages/mongodb-memory-server-core/lib
Copy link
Member

Choose a reason for hiding this comment

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

Why is this removed and all the generated files included?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am testing in the CI/CD environment with the forked version for which I needed to publish to npm.

@firefoxNX firefoxNX changed the title fix: enhance httpDownload with retry logic and stall detection fix: enhance httpDownload with retry logic Jul 7, 2025
@codecov
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

Attention: Patch coverage is 4.54545% with 63 lines in your changes missing coverage. Please review.

Project coverage is 89.77%. Comparing base (9430907) to head (338a00c).

Files with missing lines Patch % Lines
...memory-server-core/src/util/MongoBinaryDownload.ts 3.07% 63 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #931      +/-   ##
==========================================
- Coverage   90.85%   89.77%   -1.09%     
==========================================
  Files          15       15              
  Lines        2035     2063      +28     
  Branches      513      509       -4     
==========================================
+ Hits         1849     1852       +3     
- Misses        175      211      +36     
+ Partials       11        0      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hasezoey
Copy link
Member

hasezoey commented Jul 8, 2025

FYI: you can ignore the coverage report for this PR as download logic has no tests beforehand anyway. (unless you want to add some?)

Aside from that, this PR's main code looks good, but i will not merge it as long as there are extra changes (like package rename and inclusion of transpiled files in the git history)

@firefoxNX firefoxNX closed this by deleting the head repository Jul 13, 2025
@firefoxNX
Copy link
Contributor Author

Created new PR with just the changes to ts files here - #934

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MongoBinaryDownload stalls on Jenkins – add retry logic with exponential backoff

2 participants