Skip to content

CAMEL-23646: Fix inverted BackgroundTask return values in sjms, pgevent and master#23639

Merged
Croway merged 1 commit into
apache:mainfrom
Croway:fix/CAMEL-23646
May 29, 2026
Merged

CAMEL-23646: Fix inverted BackgroundTask return values in sjms, pgevent and master#23639
Croway merged 1 commit into
apache:mainfrom
Croway:fix/CAMEL-23646

Conversation

@Croway
Copy link
Copy Markdown
Contributor

@Croway Croway commented May 29, 2026

Summary

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

@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

…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.
Copy link
Copy Markdown
Contributor

@davsclaus davsclaus left a comment

Choose a reason for hiding this comment

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

50/50 % chance ;)

@github-actions
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-master
  • components/camel-pgevent
  • components/camel-sjms
All tested modules (20 modules)
  • Camel :: AI :: LangChain4j :: Embedding
  • Camel :: AI :: LangChain4j :: EmbeddingStore
  • Camel :: Consul
  • Camel :: Infinispan :: Embedded
  • Camel :: Infinispan :: Remote
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: JGroups
  • Camel :: JGroups Raft
  • Camel :: Launcher :: Container
  • Camel :: MLLP
  • Camel :: Master
  • Camel :: PgEvent
  • Camel :: Simple JMS
  • Camel :: Simple JMS2
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin
  • Camel :: Zookeeper

⚙️ View full build and test results

@Croway Croway merged commit 6001ec3 into apache:main May 29, 2026
6 checks passed
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.

2 participants