davsclaus opened a new pull request, #27399: URL: https://github.com/apache/camel/pull/27399
https://issues.apache.org/jira/browse/CAMEL-25364 Two changes to `IntegrationLauncher`, the code behind the `camel_run` and `camel_control restart` tools. ## A failed start returns its cause Before, a failed restart returned the last 4000 characters of the console output. That is mostly stack frames of the runtime, and the line that says what went wrong is above the cut: ``` Restart of run-order-generator failed with exit code 1: ...e.java:177) at org.apache.camel.impl.engine.AbstractCamelContext.startingRoutes(AbstractCamelContext.java:1196) ... ``` Now the output is folded the way `camel_get_log` shows a log (CAMEL-25296), oldest first. Each record keeps its message, an error keeps its root cause and the first frame of the user's code, and the frames are counted: ``` Restart of run-order-generator failed with exit code 1, so it is stopped now: fix the cause below, then camel_run starts it again. ERROR Failed to create route: order-generator at: >>> Bean[ref:orderNumber method:next] <<< cause: org.apache.camel.NoSuchBeanException: No bean could be found in the registry for: orderNumber at: camel.example.OrderNumber.next(OrderNumber.java:12) (34 lines of stack trace left out) ``` `camel_run`'s `output` for a start that failed uses the same folding. Output with no log records is returned as it is. ## camel_run does not start a second copy When the whole directory is the app (no files given, `camel run --source-dir`) and an integration already runs from that directory, `camel_run` returns that one (`status: running`, pid, name) and says how to reload or restart it. Before, it started a second copy, which fights the first for ports and files and makes the name ambiguous to the other tools. With explicit files nothing changes, since one directory can hold several apps. ## Found in the local-model benchmark In the r5 run of the local-model benchmark, `run-order-generator` failed 9 of its steps in 3 of 5 runs. Each time the model added a Java class, the restart failed, and the model could not see why. It started a second copy and ran out of tool calls. In another example, a second copy started by the model held port 8080 for six hours. Tests: two new cases in `IntegrationLauncherTest`; the camel-jbang-core suite passes (1512). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
