Skip to content

[backport camel-4.18.x] CAMEL-23646: Fix inverted BackgroundTask return values in sjms, pgevent and master#23641

Merged
Croway merged 1 commit into
apache:camel-4.18.xfrom
Croway:backport/23639-to-camel-4.18.x
May 29, 2026
Merged

[backport camel-4.18.x] CAMEL-23646: Fix inverted BackgroundTask return values in sjms, pgevent and master#23641
Croway merged 1 commit into
apache:camel-4.18.xfrom
Croway:backport/23639-to-camel-4.18.x

Conversation

@Croway
Copy link
Copy Markdown
Contributor

@Croway Croway commented May 29, 2026

Backport of #23639

Cherry-pick of #23639 onto camel-4.18.x.

Original PR: #23639 - CAMEL-23646: Fix inverted BackgroundTask return values in sjms, pgevent and master
Original author: @Croway
Target branch: camel-4.18.x

Original description

The BackOffBackgroundTask migration (CAMEL-22206) preserved callback return values verbatim, but the two APIs have opposite boolean semantics: BackOff returns false to stop, BackgroundTask returns true to stop. This caused infinite retry loops after successful recovery in three components.

camel-sjms/sjms2 — after a transient JMS connection interruption (reported with Oracle AQ), the consumer enters an infinite recovery loop. Each iteration destroys the working connection via refreshConnection() while initConsumers() skips re-creation (consumers != null), leaving consumers attached to closed sessions. Message consumption is permanently blocked.

camel-pgevent — after successful PostgreSQL reconnection, the task keeps calling initConnection() every reconnectDelay, leaking connections and duplicating notification listeners.

camel-master — after the delegated consumer starts, the task keeps calling ServiceHelper.startService() until budget exhaustion (default 10 iterations). Can revive a consumer after leadership loss.

Claude Code on behalf of Federico Mariani

…nt and master

The BackOff to BackgroundTask migration (CAMEL-22206) preserved the callback
return values verbatim, but the two APIs have opposite boolean semantics:
BackOff returns false to stop, BackgroundTask returns true to stop.
This caused infinite retry loops after successful recovery in all three
components.
@Croway Croway merged commit d3b0096 into apache:camel-4.18.x May 29, 2026
3 checks passed
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.

2 participants