davsclaus opened a new pull request, #29522: URL: https://github.com/apache/camel/pull/29522
_Claude Code on behalf of davsclaus_ [CAMEL-26794](https://issues.apache.org/jira/browse/CAMEL-26794) The file transport does its work (actions, the status file, traces, the lock file check) in one `scheduleWithFixedDelay` task, and the WebSocket transport its heartbeat and debug tasks the same way. They caught `Exception` but not `Error`. A `ScheduledExecutorService` never runs a task again once it throws, so one `OutOfMemoryError` on the connector thread (a memory spike while the status is collected) ended it for good, even when the JVM recovered: - the status file was never written again: `camel get`, `camel ps` and the TUI showed the numbers of that moment from then on - action files were no longer read: `camel stop`, reset-stats, send and the rest did nothing - the integration no longer noticed that its lock file was deleted while the integration itself kept routing. - New `ConnectorTasks.safely`: runs a task and ignores any `Throwable`, so the scheduler runs it again. An `Exception` is logged at debug as before. An `Error` is logged as a warning once (the task runs every second and may fail every time), and the logging is in its own try, as it can fail too when memory is short. Unlike `ScheduledPollConsumer`, the `Error` is not rethrown: that would cancel the task, which is the only way the CLI reaches the integration. - `FileCliConnectorTransport` schedules its task through it; `WebSocketCliConnectorTransport.safely` delegates to it. Found in the TUI, with the memory-leak example: its JVM stopped writing its status, and the TUI kept showing it running at its last rate. A TUI change that says so is a separate PR. Test: `FileCliConnectorTransportTest.anErrorWhileCollectingTheStatusDoesNotEndTheTask`: the status throws an `OutOfMemoryError` once, and an action is still answered afterwards. It fails without the fix. All camel-cli-connector tests pass locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
