Skip to content

feature/backoff-moq-relay-session - #317

Merged
cedricve merged 4 commits into
masterfrom
feature/backoff-moq-relay-session
Aug 17, 2026
Merged

feature/backoff-moq-relay-session#317
cedricve merged 4 commits into
masterfrom
feature/backoff-moq-relay-session

Conversation

@cedricve

@cedricve cedricve commented Aug 14, 2026

Copy link
Copy Markdown
Member

Description

Motivation

MoQ relay sessions could close without being detected promptly, while RTSPS camera trust configuration relied on process-wide certificate settings that could interfere with public services. Heartbeat failures also provided too little diagnostic information to identify the cause.

Changes

  • Monitor MoQ relay session closure and return the error immediately instead of continuing to read and publish packets.
  • Add support for AGENT_CAPTURE_IPCAMERA_RTSPS_CA_FILE, extending the system CA pool only for camera RTSPS connections.
  • Keep MoQ, Hub, Vault, and other clients on the standard public CA chain.
  • Improve heartbeat failure logs with status, duration, request errors, response bodies, and truncation indicators.
  • Add tests covering RTSPS CA handling and heartbeat diagnostics.
  • Enable the moq build tag in the VS Code launch configuration.
  • Update RTSPS TLS documentation with the safer, scoped trust configuration.

This improves relay reliability, prevents silent session failures, avoids unintended process-wide TLS changes, and makes Hub connectivity issues easier to diagnose.

Copilot AI lite review requested due to automatic review settings August 14, 2026 14:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves TLS trust handling for RTSPS camera connections, hardens Cloud heartbeat logging for failed Hub requests, and adds MoQ relay session monitoring/backoff-related behavior.

Changes:

  • Introduce AGENT_CAPTURE_IPCAMERA_RTSPS_CA_FILE to append a private camera CA bundle to the system roots only for gortsplib (without changing process-wide TLS roots).
  • Enhance heartbeat failure logs by capturing status, duration, and (bounded) response bodies, with accompanying unit tests.
  • Add MoQ relay session-closure detection during publish loop; update dev launch config to include the moq build tag.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README-RTSPS-TLS.md Documents the new camera-specific CA env var and warns against process-wide SSL_CERT_* for production.
machinery/src/cloud/livemoq_enabled.go Adds a session-closure watcher to stop publishing when the relay session closes.
machinery/src/cloud/cloud.go Adds bounded response-body capture and structured logging for heartbeat failures.
machinery/src/cloud/cloud_test.go Adds tests for heartbeat failure logging and response-body truncation.
machinery/src/capture/gortsplib.go Implements RTSPS TLS config that appends camera CA PEM to system cert pool.
machinery/src/capture/gortsplib_test.go Adds tests for the new RTSPS TLS behavior (default, insecure, CA append, invalid CA).
machinery/data/tus/1786715908_3-737_encrypted_0-0-0-0_-1_25498.mp4.primary.json Adds a tus upload-state JSON file (appears to be generated/runtime state).
.vscode/launch.json Adds moq build tag for the Go launch configuration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +190 to +194
select {
case err := <-sessionClosed:
return fmt.Errorf("relay session closed: %w", err)
default:
}
@@ -0,0 +1 @@
{"upload_url":"https://vault.kerberos.io/api/storage/tus/19e42fbc666a38064904caf8c46d182a","vault_uri":"https://vault.kerberos.io/api/storage/tus/","size":1591581} No newline at end of file
@cedricve
cedricve merged commit 6c71ff5 into master Aug 17, 2026
15 checks passed
@cedricve
cedricve deleted the feature/backoff-moq-relay-session branch August 17, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants