Skip to content

Re-pin sendspin-cpp to v0.8.0 and adopt its start/stop lifecycle - #62

Merged
chrisuthe merged 3 commits into
mainfrom
chrisuthe/task/re-pin-sendspin-cpp-to-v0-8-0-and-adopt-its-start
Sep 16, 2026
Merged

chrisuthe merged 3 commits into
mainfrom
chrisuthe/task/re-pin-sendspin-cpp-to-v0-8-0-and-adopt-its-start

Conversation

@chrisuthe

@chrisuthe chrisuthe commented Sep 16, 2026

Copy link
Copy Markdown
Member

Re-pins SENDSPIN_GIT_TAG to v0.8.0 and moves onto the lifecycle API that release introduces.

What changed

  • start_server()start(). The old name is [[deprecated]] at v0.8.0 and CI configures with -DSENDSPIN_CLI_WERROR=ON, so this was a hard build failure, not a warning. Comments naming the old symbol in src/main.cpp and src/audio_sink.h follow.
  • disconnect() + drain loop → client.stop(). stop() goodbyes every peer (reason shutdown, same as before), waits a bounded time, and delivers on_stream_end() inline before returning — so the stop hook is queued by the time control comes back and the existing hooks.flush() runs it. That retires SHUTDOWN_DRAIN_MS and its timeout warning. Shutdown ordering is unchanged: mDNS and the control socket first, then the client, then unwiring the lambda that captures main's locals.
  • liveness_timeout_ms left unset, taking the library's derived ~60 s default. No new flag, config key, wiki row or packaging entry.
  • MAX_RETRY_DELAY_MS re-checked against upstream NURSERY_ESTABLISH_TIMEOUT_S, still 30.0 at v0.8.0 — the constant stands.
  • docs/ROADMAP.md re-verified. Every version-tagged claim was re-read against the v0.8.0 tree and retagged; items 17 and 25 stay gated (still no activities/server/activate, still no bind address on SendspinClientConfig), the sync_task.cpp line citation was corrected, and the shutdown bullet describing the old drain loop was rewritten.

Verification

  • Clean from-scratch configure fetches v0.8.0; -DSENDSPIN_CLI_WERROR=ON build green with no deprecation warnings.
  • --version reports sendspin-cpp v0.8.0.
  • 428/428 unit tests pass; scripts/smoke_test.sh every check passed; scripts/format.sh --check clean under clang-format 20.1.8.
  • The stop-hook path was tested for real, not by inspection. A minimal WebSocket Sendspin server streams PCM to the CLI; SIGINT mid-playback produces client/goodbye, Stream ended, the stop hook firing, and exit 0.

Note for reviewers running the suite locally: two control-socket tests fail if the checkout path is long enough to push the socket path past sockaddr_un's 107 bytes. They pass from a shorter path, and CI's is short.

Compatibility

No breaking changes for CLI users. Checked deliberately, since a pin bump can change behaviour without touching a flag:

  • No flag added, removed, or changed in meaning; no config-file key or sendspin-cli.conf.example entry changed.
  • No change to the control-socket protocol, the state-store format, or exit codes.
  • Every existing invocation behaves as before. liveness_timeout_ms is deliberately left unset and no flag exposes it.

Three visible differences that are not breaking, but worth knowing:

  1. Dead connections are now dropped. v0.8.0 drops an established connection after 60 s of inbound silence (derived from the default time-burst settings, which we don't override); v0.7.2 never dropped one. Any inbound traffic resets it, so only a genuinely silent peer is affected — and in outbound mode RetryPacer then redials on its own, so this recovers a wedge that used to persist. Strictly an improvement, but it is new runtime behaviour.
  2. A shutdown warning is gone. "The stream did not end within 500 ms of disconnecting -- any --hook-stop has not run" no longer exists, because the case it warned about no longer exists: stop() delivers on_stream_end() before returning, so the stop hook always runs. Anything grepping logs for that string won't find it. Shutdown is now bounded by the library (50 ms per peer for goodbyes, ~300 ms for a WebSocket close, worst case the 3 s handshake timeout for a socket that connected and never upgraded) rather than by the 500 ms drain cap — comparable in wall-clock, since the old path paid the same transport teardown in the client destructor. Well inside systemd's default 90 s TimeoutStopSec; our unit sets none.
  3. --version reports sendspin-cpp v0.8.0 on its second line, which only matters to something pinning that string.

start_server() is deprecated at v0.8.0, and CI builds with -Werror, so the
rename is forced rather than optional.

stop() replaces the disconnect() plus hand-rolled drain loop: it goodbyes every
peer and delivers on_stream_end() before returning, so the stop hook is queued
by the time control comes back and hooks.flush() runs it. That makes
SHUTDOWN_DRAIN_MS and its timeout warning dead.

liveness_timeout_ms is left unset, taking the library's derived ~60 s default.
MAX_RETRY_DELAY_MS re-checked against NURSERY_ESTABLISH_TIMEOUT_S, still 30 s.
@chrisuthe
chrisuthe marked this pull request as ready for review September 16, 2026 01:33
@chrisuthe
chrisuthe requested a balanced review from Copilot September 16, 2026 01:34

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.

🟢 Approval recommended

The lifecycle migration is correct; only minor documentation inaccuracies remain.

Pull request overview

Pins sendspin-cpp v0.8.0 and adopts its lifecycle API.

Changes:

  • Replaces start_server() with start().
  • Replaces manual disconnect/draining with synchronous stop().
  • Refreshes lifecycle documentation and upstream version references.
File summaries
File Description
CMakeLists.txt Pins sendspin-cpp v0.8.0.
src/main.cpp Migrates startup and shutdown lifecycle calls.
src/audio_sink.h Updates lifecycle references.
docs/ROADMAP.md Refreshes upstream references and shutdown documentation.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Balanced

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

Comment thread src/main.cpp Outdated
Comment thread docs/ROADMAP.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: chrisuthe <26907395+chrisuthe@users.noreply.github.com>
@chrisuthe
chrisuthe merged commit dfa2c69 into main Sep 16, 2026
17 checks passed
@chrisuthe
chrisuthe deleted the chrisuthe/task/re-pin-sendspin-cpp-to-v0-8-0-and-adopt-its-start branch September 16, 2026 02:10
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.

3 participants