davsclaus opened a new pull request, #28116: URL: https://github.com/apache/camel/pull/28116
[CAMEL-25818](https://issues.apache.org/jira/browse/CAMEL-25818): `camel_run` and `camel_control restart` sent the console output of the process they started to `~/.camel/camel-launch-<number>.log` or `camel-restart-<number>.log`. They read it only to answer: the cause and the output of a start that failed, or the output of a run that is still starting. After that, the process kept writing to the file for as long as it ran. The file was deleted only when the MCP server exited (`deleteOnExit`). A server runs as long as the session of its client, so the files of finished runs stayed for days: 8 files and 12.4 MB on one machine, from three servers that Claude Code sessions started. A server that was killed never deleted them, and their names have no pid, so `camel dirty` did not know them either. ## What - **The console output goes to `~/.camel/<pid>-run.log`**, with `BackgroundLog`. That is the file that `camel run --background` and `camel restart` already use. - **It is removed when the process ends:** - after a start that failed, once the answer is made, so the answer still has the cause and the output; - for a run that started, or is still starting, when the process ends (`Process.onExit()`). - **No more `deleteOnExit`.** An integration that still runs when the server exits keeps the file while it runs, as one run with `camel run --background` does: `camel stop` removes it, and `camel dirty --clean` once the process has ended. - **A restart removes the console output of the process that stopped**, as `camel restart` does. What is no longer kept: the console output of a run after the run has ended. The log of the run has what it logged. #28107 (CAMEL-25784) keeps that log as the log of its previous run. `IntegrationLauncher` gets a package-private hook for the camel command, so a test can start another program. #28108 (CAMEL-25784) changes the same two loops in `IntegrationLauncher`, so whichever of the two is merged second needs a small rebase. ## Tests - New `IntegrationLauncherConsoleTest` (3, not on Windows). The integration is a shell script that writes its pid file and status file, as the CLI connector does, and runs until its pid file is removed, as `camel stop` does. - A start that failed: the answer has the cause and the output, and no log file is left in `~/.camel`. - A run that started: `<pid>-run.log` has the console output while the integration runs, and is removed once it ends. - A restart: the console output of the process that stopped is removed, and the new process has its own `<pid>-run.log` until it ends. - With the launcher as it was (only the hook added), all three fail. - All tests of camel-jbang-core pass (2308, 2 skipped, and 237). 🤖 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]
