Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repeated WebRTC negotiations and disconnects retain entries in the Proxy's username/address caches, connected UDP sockets and blocked backend-reader goroutines. WHIP/WHEP DELETE currently forwards the request without releasing the local session, and a 204 response is rejected.
This change closes sessions on successful DELETE, I/O failure, shutdown or 120 seconds without inbound client traffic, with a 5-second sweep. It evicts the associated indexes, bounds address-cache growth during NAT rebinding, and preserves a replacement session that reuses an address or stream key. DELETE uses the exact resource URL and the original Origin; outgoing video does not keep a departed client alive. Media lifetime is independent of the completed SDP request. Redis metadata retains its existing TTL; the memory LB removes only matching entries.
Validation:
go test -race ./...go vet ./internal/proxy ./internal/lb ./internal/syncgo test -race ./internal/proxy -run '^TestRTCSession' -count=20Regression tests cover 500 real UDP connections per churn run, idle versus active sessions, exact DELETE with HTTP 204, request cancellation, address rebinding/reuse, I/O failure, shutdown and concurrent expiry.