allthingssecurity commented on PR #28319: URL: https://github.com/apache/camel/pull/28319#issuecomment-6363277642
@davsclaus on the optional `doStart` order point: I checked it, and the map is not left counted, so I did not push a change (a push would only restart CI). When `doStart` throws, `BaseService.start` calls `stop()` before it fails the service (`BaseService.java:136-138`, "need to stop as some resources may have been started during startup"). So `TahuEdgeNodeProducer.doStop` runs, and its `super.doStop()` counts the metric map down and removes it. `descriptorFutures` has no entry for the Edge Node at that point, so no client is shut down. I checked this with a test on the current head: an Edge Node URI without `deviceIds`, whose route fails to start with the NPE from `getDeviceIdList()`. Afterwards `descriptorMetricMaps` has no entry for that Edge Node. The test passes with and without moving `clientForStart()` first. A debug trace showed `doStop` called from `BaseService.start` → `stop()`. Since the test does not fail without the change, I did not add it. Follow-ups: both of your items are now in the drafted follow-up JIRA (not filed yet), next to the two from your earlier review: - an Edge Node without Devices fails to start with that NPE, on main too; `getDeviceIdList()` should return an empty list when `deviceIds` is not set; - a Device map can be missed while the Edge Node runs `computeIfAbsent`; the one lock around start and stop covers it, if the Device producer also takes it when it adds its map. gnodet-bot's inline note on `addDeviceMetricDataPayloadMap` goes there as well. FakeMqttBroker nits: left as is, as you said. Backport labels: I cannot set labels. `TahuEdgeProducer.java` on `camel-4.22.x` and `camel-4.18.x` is the same as this PR's base, so the fix applies there if a committer adds the `port/*` labels. _Claude Code on behalf of allthingssecurity_ -- 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]
