Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAMEL-20614: deep-copy output processors during instantiation of a route template #13824

Merged
merged 5 commits into from Apr 18, 2024

Conversation

bartoszpop
Copy link
Contributor

CAMEL-20614: deep-copy output processors during instantiation of a route template

Description

When multiple threads try to instantiate and send an exchange to the same kamelet in parallel, org.apache.camel.component.kamelet.KameletConsumerNotAvailableException may be thrown because the underlying RouteTemplateDefinition is shallow-copied and changes to the RouteDefinition are reflected in the RouteTemplateDefinition.

Target

  • I checked that the commit is targeting the correct branch (note that Camel 3 uses camel-3.x, whereas Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally and I have committed all auto-generated changes

bartoszpop and others added 2 commits April 17, 2024 03:35
…ute template

When multiple threads try to instantiate and send an exchange to the same kamelet in parallel, org.apache.camel.component.kamelet.KameletConsumerNotAvailableException may be thrown because the underlying RouteTemplateDefinition is shallow-copied and changes to the RouteDefinition are reflected in the RouteTemplateDefinition.

CAMEL-20614: deep-copy output processors during instantiation of a route template

When multiple threads try to instantiate and send an exchange to the same kamelet in parallel, org.apache.camel.component.kamelet.KameletConsumerNotAvailableException may be thrown because the underlying RouteTemplateDefinition is shallow-copied and changes to the RouteDefinition are reflected in the RouteTemplateDefinition.
…emplates can lead to duplicate consumer on starutp error. (apache#13485)

(cherry picked from commit 8aab61a)
@github-actions github-actions bot added the core label Apr 17, 2024
Copy link
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.

  • You can label PRs using build-all, build-dependents, 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.

@davsclaus davsclaus merged commit 63bd587 into apache:camel-4.4.x Apr 18, 2024
2 of 3 checks passed
davsclaus added a commit that referenced this pull request Apr 18, 2024
…ute template (#13824)

* CAMEL-20614: deep-copy output processors during instantiation of a route template

When multiple threads try to instantiate and send an exchange to the same kamelet in parallel, org.apache.camel.component.kamelet.KameletConsumerNotAvailableException may be thrown because the underlying RouteTemplateDefinition is shallow-copied and changes to the RouteDefinition are reflected in the RouteTemplateDefinition.

CAMEL-20614: deep-copy output processors during instantiation of a route template

When multiple threads try to instantiate and send an exchange to the same kamelet in parallel, org.apache.camel.component.kamelet.KameletConsumerNotAvailableException may be thrown because the underlying RouteTemplateDefinition is shallow-copied and changes to the RouteDefinition are reflected in the RouteTemplateDefinition.

* CAMEL-20545: Using replaceFromWith with camel-test and having route templates can lead to duplicate consumer on starutp error. (#13485)

(cherry picked from commit 8aab61a)

* CAMEL-20614: add shallowCopy as per code review comment

* CAMEL-20614: update access modifiers of copy constructors to be protected as per code review comment

* CAMEL-20614: add unit tests

---------

Co-authored-by: Claus Ibsen <claus.ibsen@gmail.com>
@bartoszpop bartoszpop deleted the CAMEL-20614-camel-4.4.x branch April 18, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants