Skip to content

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

Merged
mraible merged 2 commits into
roller-6.1.xfrom
planet-fetch-status-and-interrupts-6.1.x
Nov 20, 2026
Merged

mraible merged 2 commits into
roller-6.1.xfrom
planet-fetch-status-and-interrupts-6.1.x

Conversation

@mraible

@mraible mraible commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Follows up #326 from review, with the same changes as the master follow-up to #314. 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.
  • On Java 11, cancelling the response future doesn't stop the exchange, so a stalled feed kept downloading after the fetcher gave up. The body subscriber now cancels its subscription when the fetcher stops waiting, which closes the connection.

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.
- On Java 11, cancelling the response future doesn't stop the exchange, so a stalled feed kept downloading after the fetcher gave up. The body subscriber now cancels its subscription when the fetcher stops waiting, which closes the connection.
- 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 6cbbbfdc7: The fix covers the reviewed feed fetch paths, and the new tests exercise the status, interrupt, and abandoned download behavior. Comparison with #340 found no missing fix hunks. Tests were not run under the review constraints.

No new issues found.

@mraible
mraible merged commit 90165f6 into roller-6.1.x Nov 20, 2026
7 checks passed
@mraible
mraible deleted the planet-fetch-status-and-interrupts-6.1.x branch November 20, 2026 00:53
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