Repository navigation
CAMEL-27149: camel-jbang - camel stop <pid> of the process that launched an integration stops that integration - #30321
Conversation
…hed an integration stops that integration Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet-bot
left a comment
There was a problem hiding this comment.
The fix is correct and the approach is safe — launchedBy() short-circuits for --all, non-numeric names, and existing Camel integration pids, so the existing code paths are unchanged. The two new tests cover the success and failure cases, and the verify(launcher, never()).destroy() assertions confirm the safety constraint.
One doc finding below; the code and tests are solid.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 5 of 729 tested, 8 compile-only — current: 5 all testedMaveniverse Scalpel detected 5 affected modules (current approach: 5). Skip-tests mode would test 5 modules (2 direct + 5 downstream), skip tests for 8 (generated code, meta-modules) Modules Scalpel would test (5)
Modules with tests skipped (8)
💡 Manual integration tests recommended:
All tested modules (15 modules, 3m 45s total)Total reactor time: 3m 45s
Top 20 slowest modules:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gnodet-bot
left a comment
There was a problem hiding this comment.
Following up on my earlier review — the one finding has been addressed.
The sentence was split into three shorter active-voice sentences. ✅
This review was generated by an AI agent, Hermès on behalf of @gnodet.
oscerd
left a comment
There was a problem hiding this comment.
Good restoration that does not undo the safety it builds on. CAMEL-26911 tightened camel stop <pid> to signal only a verified running Camel integration, which is what stopped it from killing a pid-reused unrelated process, but it also broke giving it the pid of the launcher (the shell or JBang launcher of camel run), which Citrus relies on.
The fix is the right shape: when the pid is not itself a Camel integration, launchedBy finds the integrations that process started (the Camel JVM is its child) and stops those, falling back to the direct integration lookup otherwise, and a match of nothing exits with code 3. Crucially it still signals only verified Camel integrations, the children, never the raw launcher pid, so the pid-reuse protection from CAMEL-26911 is intact: this widens what you can name without widening what gets signalled. Landing it before 4.24.0 so Citrus keeps working is the right call. Good.
Claude Code on behalf of oscerd
CAMEL-27149:
camel stop <pid>can now be given the pid of the process that launched an integration, such as the shell or the JBang launcher ofcamel run. It stops the Camel integrations that process launched. Before 4.24.0 ships, this restores what Citrus relies on.The regression
Since CAMEL-26911 and CAMEL-26929,
camel stop <pid>accepts only the pid of a running Camel integration, and exits3for any other pid. In 4.23 a numeric pid was used as given, so the process got a SIGTERM.Citrus (
CamelStopIntegrationAction) keeps the pid of the process it started. On Linux that is the launcher, while the Camel JVM is its child: 3469 and 3470, 3906 and 3907, and so on. At the end of each test Citrus runscamel stop 3469, and it stops the children only after that command succeeds.With 4.24.0-SNAPSHOT:
3;The integration tests of camel-kamelets on 4.24.0-SNAPSHOT (apache/camel-kamelets#3186) show it: 35 tests failed with
Failed to stop Camel integration - exit code 3, and the runner was shut down.The fix
When the pid is not a Camel integration,
StopProcesstakes the running Camel integrations that are descendants of that process, and stops them as it does any integration: it deletes the pid file, and waits.Two things do not change:
3.The
camel stopsection of the docs says so.Tests
StopProcessTest:3, and nothing is signalled.The process and common tests of camel-jbang-core (761) pass.
End to end: I started an integration as Citrus does on Linux, under a parent process (
bash -c "jbang camel@apache/camel run tick.yaml; true"), then rancamel stop <parent pid>:3, "No running Camel integration matches: 28170"0Claude Code on behalf of Claus Ibsen
🤖 Generated with Claude Code