client: prune mcast group immediately on disconnect#555
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR reduces the default PIM join holdtime to 120 s and prune holdtime to 5 s, updates the server to pass these values when constructing messages, and aligns tests and the CLI tool accordingly.
- Lower PIM Join holdtime from 210 s to 120 s and Prune holdtime from 210 s to 5 s
- Introduce
joinHoldtime/pruneHoldtimein the PIM server and wire through toconstructJoinPruneMessage - Update tests’ expected checksums and holdtimes; add CLI flags to the send command including a configurable holdtime
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| client/doublezerod/internal/runtime/run_test.go | Updated expected holdtime values and checksums in tests |
| client/doublezerod/internal/pim/server_test.go | Updated expected holdtime values and checksums in tests |
| client/doublezerod/internal/pim/server.go | Added joinHoldtime/pruneHoldtime vars and passed them |
| client/doublezerod/internal/pim/pim.go | Changed error messages to lowercase for Go best practices |
| client/doublezerod/internal/pim/cmd/send/send.go | Extended CLI with flags for join/prune and holdtime |
Comments suppressed due to low confidence (1)
client/doublezerod/internal/pim/cmd/send/send.go:21
- [nitpick] Add a unit test for the send command to verify that the
-holdtimeflag is parsed correctly and applied to the generated PIM messages.
holdtime = flag.Int("holdtime", 120, "holdtime for JoinPrune messages (default 210 seconds)")
bgm-malbeclabs
approved these changes
Jun 11, 2025
vihu
approved these changes
Jun 11, 2025
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.
Summary
When a client is subscribed to a multicast group and either shuts down doublezerod or disconnects their tunnel, the upstream DoubleZero device was continuing to replicate multicast traffic towards the user for up to 210s due to mroute state not being purged. This was because we were setting the same holdtime on PIM join and prune messages which dictates how long an upstream router should maintain join or prune state:
RFC7761, section 4.9.5:
This PR lowers the holdtime for join messages to 120s and prune messages to 5s.
Testing
Create tunnel and verify PIM join is sent w/ 2m holdtime:
Verify mroute state is created on the dzd:
Disconnect from group and verify PIM prune is sent w/ 5s holdtime:
Verify mroute state is immediately purged: