apiVersion: jenkins.io/v1 kind: PipelineActivity metadata: annotations: lighthouse.jenkins-x.io/cloneURI: https://github.com/greencapitaltrade/deadpool.git lighthouse.jenkins-x.io/job: release pipeline.jenkins-x.io/traceID: a6bc99ee5284e0766fe3a92f4b34914e creationTimestamp: "2026-05-30T09:04:33Z" generation: 7 labels: branch: main build: "44" context: release created-by-lighthouse: "true" event-GUID: 8940abbc-5c06-11f1-9e4b-509ac5bba4e2 lighthouse.jenkins-x.io/baseSHA: 1330ad718ddf40c4aedd293fb51b23c3bce5789f lighthouse.jenkins-x.io/branch: main lighthouse.jenkins-x.io/buildNum: "1780131865593" lighthouse.jenkins-x.io/context: release lighthouse.jenkins-x.io/id: pitaltrade-deadpool-main-release-bml4r lighthouse.jenkins-x.io/job: release lighthouse.jenkins-x.io/lastCommitSHA: 1330ad718ddf40c4aedd293fb51b23c3bce5789f lighthouse.jenkins-x.io/refs.org: greencapitaltrade lighthouse.jenkins-x.io/refs.repo: deadpool lighthouse.jenkins-x.io/type: postsubmit owner: greencapitaltrade podName: pitaltrade-deadpool-main-release-qktv6-from-build-pack-pod provider: github repository: deadpool tekton.dev/pipeline: pitaltrade-deadpool-main-release-qktv6 managedFields: - apiVersion: jenkins.io/v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:labels: f:branch: {} f:context: {} f:owner: {} f:provider: {} f:repository: {} f:spec: f:lastCommitMessage: {} f:lastCommitSHA: {} f:releaseNotesURL: {} f:version: {} manager: jx-changelog-0.10.18 operation: Update time: "2026-05-30T09:12:11Z" - apiVersion: jenkins.io/v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:lighthouse.jenkins-x.io/cloneURI: {} f:lighthouse.jenkins-x.io/job: {} f:pipeline.jenkins-x.io/traceID: {} f:labels: .: {} f:build: {} f:created-by-lighthouse: {} f:event-GUID: {} f:lighthouse.jenkins-x.io/baseSHA: {} f:lighthouse.jenkins-x.io/branch: {} f:lighthouse.jenkins-x.io/buildNum: {} f:lighthouse.jenkins-x.io/context: {} f:lighthouse.jenkins-x.io/id: {} f:lighthouse.jenkins-x.io/job: {} f:lighthouse.jenkins-x.io/lastCommitSHA: {} f:lighthouse.jenkins-x.io/refs.org: {} f:lighthouse.jenkins-x.io/refs.repo: {} f:lighthouse.jenkins-x.io/type: {} f:podName: {} f:tekton.dev/pipeline: {} f:spec: .: {} f:baseSHA: {} f:batchPipelineActivity: {} f:build: {} f:buildLogsUrl: {} f:completedTimestamp: {} f:context: {} f:gitBranch: {} f:gitOwner: {} f:gitRepository: {} f:gitUrl: {} f:message: {} f:pipeline: {} f:startedTimestamp: {} f:status: {} f:steps: {} manager: jx-build-controller operation: Update time: "2026-05-30T09:12:59Z" name: greencapitaltrade-deadpool-main-44 namespace: jx resourceVersion: "62563182" uid: 533b2bf7-16f7-4067-ba9d-af3dba1d2b29 spec: baseSHA: 1330ad718ddf40c4aedd293fb51b23c3bce5789f batchPipelineActivity: {} build: "44" buildLogsUrl: s3://logs-gct-prod-20260425045301534100000007/jenkins-x/logs/greencapitaltrade/deadpool/main/44.log completedTimestamp: "2026-05-30T09:12:53Z" context: release gitBranch: main gitOwner: greencapitaltrade gitRepository: deadpool gitUrl: https://github.com/greencapitaltrade/deadpool.git lastCommitMessage: | feat(iot-common,iot-mqtt-server): Terra v1 SessionCache TTL eviction (Phase 3c-2) Closes the known gap from Phase 3b (deadpool#60): rumqttd's Link interface doesn't surface a clean "device disconnected" notification, so we couldn't drop SessionCache entries on disconnect. The protocol's "first packet of every session must be FULL" guarantees that reconnecting devices reset their entry naturally — but devices that disconnect and never reconnect would otherwise leak their entry forever. This adds the periodic-eviction safety net. What's in this PR: - DeviceSession gains a `last_processed_at: Option>` field. `SessionCache::process()` stamps it on every successful call. - `SessionCache::evict_stale(max_age: chrono::Duration) -> usize` walks the cache and drops entries whose last packet is older than max_age. Returns the eviction count for metrics/logging. - iot-mqtt-server's main loop calls evict_stale every 5 minutes with a 24-hour TTL. Cheap (O(n) over a small set) and runs before notification processing each iteration so the eviction work doesn't build up while the broker is idle. - 3 new unit tests: * process_updates_last_processed_at * evict_stale_drops_old_entries_only * evict_stale_keeps_everything_when_threshold_is_long Test results: - `cargo test -p iot-common --lib protocols::terra_v1::session_cache` → 14 passed, 0 failed. - Full iot-common suite: 99 passed, 0 failed. - iot-mqtt-server: 7 passed, 0 failed. Why 24-hour TTL: the v1 protocol's FORCE_FULL latch (§5.2 rule 6) means a device that re-attaches after the eviction simply gets told to send FULL on its next packet, which is exactly what it would do on a fresh MQTT session anyway. So the TTL value is mostly a memory-bound choice, not a correctness choice. 24h gives slow-cycle devices comfortable headroom while keeping the cache bounded. Co-Authored-By: Claude Opus 4.7 lastCommitSHA: 49d1aa1c495f5ba7be08f6a5b0644c7c5f38b29a message: 'Tasks Completed: 1 (Failed: 0, Cancelled 0), Skipped: 0' pipeline: greencapitaltrade/deadpool/main releaseNotesURL: https://github.com/greencapitaltrade/deadpool/releases/tag/v0.52.1 startedTimestamp: "2026-05-30T09:04:33Z" status: Succeeded steps: - kind: Stage stage: completedTimestamp: "2026-05-30T09:12:53Z" name: from build pack startedTimestamp: "2026-05-30T09:04:44Z" status: Succeeded steps: - completedTimestamp: "2026-05-30T09:04:45Z" name: Git Clone startedTimestamp: "2026-05-30T09:04:44Z" status: Succeeded - completedTimestamp: "2026-05-30T09:04:49Z" name: Next Version startedTimestamp: "2026-05-30T09:04:47Z" status: Succeeded - completedTimestamp: "2026-05-30T09:04:52Z" name: Jx Variables startedTimestamp: "2026-05-30T09:04:49Z" status: Succeeded - completedTimestamp: "2026-05-30T09:11:52Z" name: Build Cargo Install startedTimestamp: "2026-05-30T09:05:07Z" status: Succeeded - completedTimestamp: "2026-05-30T09:11:55Z" name: Check Registry startedTimestamp: "2026-05-30T09:11:53Z" status: Succeeded - completedTimestamp: "2026-05-30T09:11:57Z" name: Build Server Image startedTimestamp: "2026-05-30T09:11:55Z" status: Succeeded - completedTimestamp: "2026-05-30T09:11:58Z" name: Build Consumer Image startedTimestamp: "2026-05-30T09:11:57Z" status: Succeeded - completedTimestamp: "2026-05-30T09:12:00Z" name: Build Mqtt Image startedTimestamp: "2026-05-30T09:11:59Z" status: Succeeded - completedTimestamp: "2026-05-30T09:12:11Z" name: Promote Changelog startedTimestamp: "2026-05-30T09:12:01Z" status: Succeeded - completedTimestamp: "2026-05-30T09:12:15Z" name: Promote Helm Release startedTimestamp: "2026-05-30T09:12:12Z" status: Succeeded - completedTimestamp: "2026-05-30T09:12:53Z" name: Promote Jx Promote startedTimestamp: "2026-05-30T09:12:15Z" status: Succeeded - kind: Promote promote: environment: staging pullRequest: pullRequestURL: https://github.com/greencapitaltrade/mcu/pull/4033 startedTimestamp: "2026-05-30T09:12:34Z" status: Succeeded startedTimestamp: "2026-05-30T09:12:34Z" status: Succeeded - kind: Promote promote: environment: production pullRequest: pullRequestURL: https://github.com/greencapitaltrade/mcu/pull/4034 startedTimestamp: "2026-05-30T09:12:50Z" status: Succeeded startedTimestamp: "2026-05-30T09:12:50Z" status: Succeeded version: 0.52.1 status: {}