Skip to content

Fix/ftp stale session - #367

Merged
luabida merged 4 commits into
AlertaDengue:mainfrom
luabida:fix/ftp-stale-session
Oct 2, 2026
Merged

luabida merged 4 commits into
AlertaDengue:mainfrom
luabida:fix/ftp-stale-session

Conversation

@luabida

@luabida luabida commented Oct 2, 2026

Copy link
Copy Markdown
Member

No description provided.

Large DATASUS transfers are throttled and dropped mid-stream; restarting
them from zero on every retry meant they could never finish. Resume from
the partial file via REST (retrbinary rest=), keep FTP partials between
retries, and stop abandoning the worker thread so a stalled transfer is
joined before the session is reset.
The resume guard compared the client origin to lowercase "ftp", but the
FTP client reports "FTP", so every retry deleted the partial and the
download restarted from zero — defeats REST resume for large files.
_retr_with_resume now calls retrbinary(..., rest=...) and reads ftp.size();
update the two mocks that predate it.
@luabida
luabida marked this pull request as ready for review October 2, 2026 16:02
@codecov-commenter

codecov-commenter commented Oct 2, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 97.22222% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@c732b57). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pysus/management/sync.py 93.10% 2 Missing ⚠️
pysus/tests/management/test_sync.py 98.68% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #367   +/-   ##
=======================================
  Coverage        ?   97.19%           
=======================================
  Files           ?      180           
  Lines           ?    22998           
  Branches        ?        0           
=======================================
  Hits            ?    22354           
  Misses          ?      644           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 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.

@luabida
luabida merged commit 05cf755 into AlertaDengue:main Oct 2, 2026
15 checks passed
@luabida
luabida deleted the fix/ftp-stale-session branch October 2, 2026 16:02
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.11.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants