You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/10/06 14:24:16 UTC
[PR] CAMEL-25344: camel-infinispan - wrap schema registration in query ITs with retry [camel]
gnodet opened a new pull request, #27445:
URL: https://github.com/apache/camel/pull/27445
#### What type of PR is this?
/kind bug
#### Jira issue
https://issues.apache.org/jira/browse/CAMEL-25344
#### Community Guidelines
https://camel.apache.org/community/contributing/
#### Description
`InfinispanRemoteQueryProducerIT` and `InfinispanRemoteQueryConsumerIT` both called
`cacheContainer.administration().schemas().create()` in their `setupResources()` without any retry or wait mechanism.
Under `-T1C` parallel builds, Docker contention makes Infinispan slower to fully
initialize its internal `___protobuf_metadata` cache. When that cache is not yet
ready, the `schemas().create()` call fails with a `TransportException` (connection refused)
or a `RemoteIllegalLifecycleStateException`, causing the tests to fail.
**Root cause:** The parent class `InfinispanRemoteTestSupport` already uses a `ForegroundTask`
retry loop for regular cache creation (`createCache()`), but the schema registration in the
query ITs had no such retry.
**Fix:** Add a `registerSchema(FileDescriptorSource)` method to `InfinispanRemoteQueryTestSupport`
that wraps `cacheContainer.administration().schemas().create()` in a `ForegroundTask` retry
loop (up to 30 iterations, 1 second interval). Both query ITs are updated to call this method
instead of the bare `schemas().create()`.
This mirrors the existing retry patterns:
- `InfinispanRemoteTestSupport.createCache()` (same module)
- `LangChain4jEmbeddingsComponentInfinispanTargetIT.setupResources()` (CAMEL-23253, commit 80824e44d08)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25344: camel-infinispan - wrap schema registration in query ITs with retry [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #27445:
URL: https://github.com/apache/camel/pull/27445#discussion_r4203984026
##########
components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryTestSupport.java:
##########
@@ -78,4 +88,30 @@ public static boolean hasUser(List<User> users, String name, String surname) {
return false;
}
+ /**
+ * Registers a protobuf schema with the Infinispan server, retrying on transient errors. Under parallel {@code -T1C}
+ * builds the server's internal {@code ___protobuf_metadata} cache may not be ready yet, causing connection or
+ * lifecycle state exceptions. The retry loop mirrors the pattern used by
+ * {@link InfinispanRemoteTestSupport#createCache()} for regular cache creation.
+ *
+ * @param schema the protobuf schema descriptor to register
+ */
+ protected void registerSchema(FileDescriptorSource schema) {
+ final IterationBoundedBudget budget
+ = Budgets.iterationBudget().withInterval(Duration.ofSeconds(1)).withMaxIterations(30).build();
+ final ForegroundTask task = Tasks.foregroundTask()
+ .withBudget(budget).build();
+
+ final boolean registered = task.run(null, () -> {
+ try {
+ cacheContainer.administration().schemas().create(schema);
+ return true;
+ } catch (Exception e) {
+ LOG.warn("Unable to register protobuf schema (will retry): {}", e.getMessage(), e);
+ return false;
+ }
+ });
+
+ Assumptions.assumeTrue(registered, "The Infinispan protobuf schema could not be registered");
Review Comment:
With `assumeTrue`, a persistent failure makes the ITs pass by not running. The parent class does the same, but a failed assertion would be more honest here.
##########
components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryTestSupport.java:
##########
@@ -78,4 +88,30 @@ public static boolean hasUser(List<User> users, String name, String surname) {
return false;
}
+ /**
+ * Registers a protobuf schema with the Infinispan server, retrying on transient errors. Under parallel {@code -T1C}
+ * builds the server's internal {@code ___protobuf_metadata} cache may not be ready yet, causing connection or
+ * lifecycle state exceptions. The retry loop mirrors the pattern used by
+ * {@link InfinispanRemoteTestSupport#createCache()} for regular cache creation.
+ *
+ * @param schema the protobuf schema descriptor to register
+ */
+ protected void registerSchema(FileDescriptorSource schema) {
+ final IterationBoundedBudget budget
+ = Budgets.iterationBudget().withInterval(Duration.ofSeconds(1)).withMaxIterations(30).build();
+ final ForegroundTask task = Tasks.foregroundTask()
+ .withBudget(budget).build();
+
+ final boolean registered = task.run(null, () -> {
+ try {
+ cacheContainer.administration().schemas().create(schema);
+ return true;
+ } catch (Exception e) {
+ LOG.warn("Unable to register protobuf schema (will retry): {}", e.getMessage(), e);
Review Comment:
This retries every exception, so a real error such as a bad `.proto` is retried 30 times and then the test is skipped. Could it catch only the transient ones (e.g. `TransportException`)? Also, logging the full stack trace on each of up to 30 attempts is noisy; maybe the message only, and the trace at debug.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25344: camel-infinispan - wrap schema registration in query ITs with retry [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27445:
URL: https://github.com/apache/camel/pull/27445#issuecomment-6018489992
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: 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](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25344: camel-infinispan - wrap schema registration in query ITs with retry [camel]
Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd commented on code in PR #27445:
URL: https://github.com/apache/camel/pull/27445#discussion_r4204213442
##########
components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryTestSupport.java:
##########
@@ -78,4 +88,30 @@ public static boolean hasUser(List<User> users, String name, String surname) {
return false;
}
+ /**
+ * Registers a protobuf schema with the Infinispan server, retrying on transient errors. Under parallel {@code -T1C}
+ * builds the server's internal {@code ___protobuf_metadata} cache may not be ready yet, causing connection or
Review Comment:
**The refused connects point to Podman host-network + IPv6 loopback, not ___protobuf_metadata readiness**
The failures in CAMEL-25344 (and in the re-run with this PR) look like a different root cause from the `___protobuf_metadata` readiness one. Every refused connect goes to `localhost/[0:0:0:0:0:0:0:1]:11222`, i.e. the IPv6 loopback on the fixed port 11222. A fixed 11222 means `InfinispanLocalContainerInfraService` is in host-network mode, which `isHostNetworkMode()` turns on for Linux + Podman: `port()` then returns 11222 and `host()` returns `container.getHost()` (`localhost`). The server binds IPv4 only (the image's `launch.sh` appends `--bind-address=0.0.0.0`), while the Hot Rod client resolves `localhost` through Netty's round-robin resolver, which picks randomly among all hosts-file addresses, and Fedora maps `localhost` to both `127.0.0.1` and `::1`. So any connect that lands on `::1` is refused however ready the server is. That fits what we see: it hits other IT classes too (ConfigurationIT, KeyValueRepositoryIT, the Spring ITs), none of the refused connects goes to `127.0.0
.1` (a server that was not up would refuse both), and CI on Docker (no host mode) never sees it. A `___protobuf_metadata` cache that is not ready would answer with a server-side error, not a refused TCP connect.
So the retry can only mask this for the two wrapped calls. Fixing it in the test infra, e.g. having `host()` return `127.0.0.1` when `isNetworkHost` is true (or making the server listen dual-stack), would cover every Infinispan IT, and the retry is then probably unnecessary. Side note: the `Failed to register Infinispan schema after PT1M of retries` lines do not mean a minute of retries; `InfinispanRemoteManager.registerSchemaWithRetry` rethrows non-lifecycle exceptions, `BackgroundTask.run()` returns false, and that message is printed with the real cause dropped.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25344: camel-infinispan - wrap schema registration in query ITs with retry [camel]
Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier commented on PR #27445:
URL: https://github.com/apache/camel/pull/27445#issuecomment-6037403913
fixed with https://github.com/apache/camel/pull/27484
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25344: camel-infinispan - wrap schema registration in query ITs with retry [camel]
Posted by "apupier (via GitHub)" <gi...@apache.org>.
apupier closed pull request #27445: CAMEL-25344: camel-infinispan - wrap schema registration in query ITs with retry
URL: https://github.com/apache/camel/pull/27445
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25344: camel-infinispan - wrap schema registration in query ITs with retry [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27445:
URL: https://github.com/apache/camel/pull/27445#issuecomment-6018795690
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `components/camel-infinispan/camel-infinispan`
---
<details><summary>:microscope: Scalpel shadow comparison â Scalpel: 1 of 699 tested, 0 compile-only â current: 11 all tested</summary>
[Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **1 affected modules** (current approach: 11).
**Skip-tests mode would test 1 modules** (1 direct + 0 downstream), **skip tests for 0** (generated code, meta-modules)
<details><summary>Modules only in current approach (10)</summary>
- `camel-jbang-mcp`
- `camel-jbang-plugin-mcp`
- `camel-jbang-plugin-route-parser`
- `camel-jbang-plugin-tui`
- `camel-jbang-plugin-validate`
- `camel-langchain4j-embeddings`
- `camel-langchain4j-embeddingstore`
- `camel-launcher-container`
- `camel-yaml-dsl-validator`
- `camel-yaml-dsl-validator-maven-plugin`
</details>
<details><summary>Modules Scalpel would test (1)</summary>
- `camel-infinispan` â components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryConsumerIT.java, components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryProducerIT.java, components/camel-infinispan/camel-infinispan/src/test/java/org/apache/camel/component/infinispan/remote/InfinispanRemoteQueryTestSupport.java
</details>
> :information_source: Shadow mode â Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
</details>
:warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
- `components/camel-infinispan/camel-infinispan`: 2 test(s) disabled on GitHub Actions
<details><summary>All tested modules (11 modules, 3m 2s total)</summary>
**Total reactor time:** 3m 2s
| Module | Duration | Status |
| --- | --- | --- |
| Camel :: Infinispan :: Remote | 59.9s | SUCCESS |
| Camel :: JBang :: Plugin :: TUI | 45.3s | SUCCESS |
| Camel :: JBang :: MCP | 29.7s | SUCCESS |
| Camel :: AI :: LangChain4j :: EmbeddingStore | 18.4s | SUCCESS |
| Camel :: YAML DSL :: Validator | 15.2s | SUCCESS |
| Camel :: JBang :: Plugin :: Validate | 7.0s | SUCCESS |
| Camel :: YAML DSL :: Validator Maven Plugin | 2.1s | SUCCESS |
| Camel :: JBang :: Plugin :: MCP | 1.5s | SUCCESS |
| Camel :: Launcher :: Container | 1.4s | SUCCESS |
| Camel :: JBang :: Plugin :: Route Parser | 1.1s | SUCCESS |
| Camel :: AI :: LangChain4j :: Embedding | n/a | |
**Top 20 slowest modules:**
- `Camel :: Infinispan :: Remote` (59.9s)
- `Camel :: JBang :: Plugin :: TUI` (45.3s)
- `Camel :: JBang :: MCP` (29.7s)
- `Camel :: AI :: LangChain4j :: EmbeddingStore` (18.4s)
- `Camel :: YAML DSL :: Validator` (15.2s)
- `Camel :: JBang :: Plugin :: Validate` (7.0s)
- `Camel :: YAML DSL :: Validator Maven Plugin` (2.1s)
- `Camel :: JBang :: Plugin :: MCP` (1.5s)
- `Camel :: Launcher :: Container` (1.4s)
- `Camel :: JBang :: Plugin :: Route Parser` (1.1s)
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/37478662655)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25344: camel-infinispan - wrap schema registration in query ITs with retry [camel]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #27445:
URL: https://github.com/apache/camel/pull/27445#issuecomment-6018404064
<!-- camel-backport-bot -->
### đ Backport Bot
This bugfix targets `main` and may need porting to:
- `camel-4.22.x`
Add a `port/<branch>` label to automatically create a backport PR for that branch.
Backport PRs will be created automatically on merge (once a port label is added). Comment `/port` to create them immediately.
âšī¸ If you push additional commits after `/port`, use `/port` again to update the port PRs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org