Skip to content

Keep interrupts, check the HTTP status and stop abandoned feed downloads - #340

Merged
mraible merged 2 commits into
masterfrom
planet-fetch-status-and-interrupts
Nov 20, 2026
Merged

mraible merged 2 commits into
masterfrom
planet-fetch-status-and-interrupts

Conversation

@mraible

@mraible mraible commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Follows up #314 from review. Changes to the planet feed fetcher (RomeFeedFetcher):

  • An interrupted fetch restores the thread's interrupt flag before throwing FetcherException.
  • A malformed feed URL fails with a FetcherException instead of the IllegalArgumentException from URI.create.
  • A response other than 2xx fails with its status instead of being parsed as a feed.
  • When the fetcher stops waiting, the body subscriber cancels its subscription, so the download doesn't go on in the background.

Tests: new RomeFeedFetcherLimitsTest cases cover an abandoned download being closed, a 404, a malformed URL and a kept interrupt. The timing tests allow more time, so a slow build machine doesn't fail them.

A further review pass added these fixes:

  • When the feed updater is interrupted, it stops instead of trying, and failing, every remaining subscription.
  • Feed fetch errors shown to admins are reliably the intended ones: "Feed request returned HTTP status 404", "Feed is larger than ...", and "Feed URL is not valid - " instead of the URI parser's message.

Review follow-ups for the planet feed fetcher:

- An interrupted fetch restores the thread's interrupt flag before throwing FetcherException.
- A malformed feed URL fails with a FetcherException instead of the IllegalArgumentException from URI.create.
- A response other than 2xx fails with its status instead of being parsed as a feed.
- When the fetcher stops waiting, the body subscriber cancels its subscription, so the download doesn't go on in the background.
- The timing tests allow more time, so a slow build machine doesn't fail them.
@mraible
mraible requested a review from snoopdave November 18, 2026 04:16
Once the feed updater's thread is interrupted, the updater now stops instead of trying every remaining subscription, and the fetcher no longer opens a request it would abandon straight away.

When a download is stopped because of its HTTP status or size, the reason is recorded before the subscription is cancelled, so the HTTP client's own error from the cancel can no longer replace it.

An invalid feed URL now reports "Feed URL is not valid" to the admin adding the subscription instead of the URI parser's message.

The interrupt test now interrupts a fetch that is waiting for its feed, checks that the failure was caused by the interrupt and is bounded by a timeout.

@snoopdave snoopdave left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review of 9c726f07a: The interrupt, HTTP status, and download cancellation changes are consistent with their callers. The twin PR has the same patch hunks; no actionable defects were identified. No build or tests were run, as requested.

No new issues found.

@mraible
mraible merged commit 2403ec9 into master Nov 20, 2026
9 checks passed
@mraible
mraible deleted the planet-fetch-status-and-interrupts branch November 20, 2026 00:52
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.

3 participants