You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/07/28 07:48:00 UTC
[jira] [Resolved] (CAMEL-24278) camel-support - BackgroundTask should keep task registered in TaskManagerRegistry during blocking run
[ https://issues.apache.org/jira/browse/CAMEL-24278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Claus Ibsen resolved CAMEL-24278.
---------------------------------
Assignee: Claus Ibsen
Resolution: Fixed
> camel-support - BackgroundTask should keep task registered in TaskManagerRegistry during blocking run
> -----------------------------------------------------------------------------------------------------
>
> Key: CAMEL-24278
> URL: https://issues.apache.org/jira/browse/CAMEL-24278
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.22.0
>
>
> When a BackgroundTask is used via the blocking run() method (e.g. Kafka reconnection, PgEvent, SMPP), the task removes itself from the TaskManagerRegistry inside runTaskWrapper() as soon as the supplier succeeds or the budget exhausts. This happens before run() returns and before waitForTaskCompletion() cleans up.
> This causes the task to be invisible in the Internal Tasks dev console even though the blocking run() call has not returned. For the Kafka reconnection use case, this means the TUI Internal Tasks tab cannot show the reconnection task reliably.
> The fix: when run() is called (blocking path), register the task in the registry immediately in run() and skip add/remove in runTaskWrapper(). Let waitForTaskCompletion() handle the final cleanup. The schedule() path (non-blocking, used by SJMS and Master) is unchanged.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)