Skip to content

ai/live: terminate streams signaled by heartbeat response#3902

Open
gioelecerati wants to merge 1 commit into
masterfrom
gio/feat/stream-termination
Open

ai/live: terminate streams signaled by heartbeat response#3902
gioelecerati wants to merge 1 commit into
masterfrom
gio/feat/stream-termination

Conversation

@gioelecerati
Copy link
Copy Markdown
Member

sendHeartbeat was only inspecting the HTTP status code and discarding the response body on 2xx, so the terminatedStreamIds list from the gateway was silently dropped and affected streams kept heartbeating forever.

What does this pull request do? Explain your changes. (required)
Parse the body, and for each returned stream id look up the matching LivePipeline and invoke its kickInput func (stored as StopStream on the pipeline at registerControl time). That triggers the existing cleanup chain: segmenter cancel → cleanupControl → orchCancel.

Specific updates (required)

How did you test each of these updates (required)

Does this pull request close any open issues?

Checklist:

sendHeartbeat was only inspecting the HTTP status code and discarding the
response body on 2xx, so the terminatedStreamIds list from the gateway was
silently dropped and affected streams kept heartbeating forever.

Parse the body, and for each returned stream id look up the matching
LivePipeline and invoke its kickInput func (stored as StopStream on the
pipeline at registerControl time). That triggers the existing cleanup
chain: segmenter cancel → cleanupControl → orchCancel.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added go Pull requests that update Go code AI Issues and PR related to the AI-video branch. labels Apr 17, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 6.66667% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.85752%. Comparing base (9e68815) to head (9558bda).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
server/ai_mediaserver.go 7.50000% 34 Missing and 3 partials ⚠️
server/ai_live_video.go 0.00000% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #3902         +/-   ##
===================================================
- Coverage   32.87450%   32.85752%   -0.01698%     
===================================================
  Files            171         171                 
  Lines          42063       42103         +40     
===================================================
+ Hits           13828       13834          +6     
- Misses         27194       27225         +31     
- Partials        1041        1044          +3     
Files with missing lines Coverage Δ
core/livepeernode.go 75.16779% <ø> (ø)
server/ai_live_video.go 0.00000% <0.00000%> (ø)
server/ai_mediaserver.go 6.68693% <7.50000%> (+0.04136%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e68815...9558bda. Read the comment docs.

Files with missing lines Coverage Δ
core/livepeernode.go 75.16779% <ø> (ø)
server/ai_live_video.go 0.00000% <0.00000%> (ø)
server/ai_mediaserver.go 6.68693% <7.50000%> (+0.04136%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Issues and PR related to the AI-video branch. go Pull requests that update Go code

Projects

No open projects
Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant