Use nonce in data messages to de-dupe SendData API. (#3366)

* Use nonce in data messages to de-dupe SendData API.

With API retries, it is possible that some data messages are sent
multiple times. Check the nonce (if present) to de-dupe data messages
before forwarding it to the clients.

* add nonce to UserPacket

* defer unlock

* 128-bit UUID as nonce

* - UUID nonce
- make a UserPacketDeduper module for easier re-use.

* deps

* feedback
This commit is contained in:
Raja Subramanian
2025-01-27 15:35:37 +05:30
committed by GitHub
parent 30669722c3
commit db75092aa6
8 changed files with 184 additions and 26 deletions
+6 -6
View File
@@ -13,6 +13,7 @@ require (
github.com/frostbyte73/core v0.1.0
github.com/gammazero/deque v1.0.0
github.com/gammazero/workerpool v1.1.3
github.com/google/uuid v1.6.0
github.com/google/wire v0.6.0
github.com/gorilla/websocket v1.5.3
github.com/hashicorp/go-version v1.7.0
@@ -21,7 +22,7 @@ require (
github.com/jxskiss/base62 v1.1.0
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
github.com/livekit/mediatransportutil v0.0.0-20241220010243-a2bdee945564
github.com/livekit/protocol v1.32.1-0.20250123040441-6ec1903b3635
github.com/livekit/protocol v1.32.1-0.20250127091625-9a579a69ba38
github.com/livekit/psrpc v0.6.1-0.20241018124827-1efff3d113a8
github.com/mackerelio/go-osstat v0.2.5
github.com/magefile/mage v1.15.0
@@ -55,7 +56,7 @@ require (
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8
golang.org/x/sync v0.10.0
google.golang.org/protobuf v1.36.3
google.golang.org/protobuf v1.36.4
gopkg.in/yaml.v3 v3.0.1
)
@@ -89,7 +90,6 @@ require (
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/subcommands v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
@@ -136,8 +136,8 @@ require (
golang.org/x/sys v0.29.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/tools v0.29.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250122153221-138b5a5a4fd4 // indirect
google.golang.org/grpc v1.69.4 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250124145028-65684f501c47 // indirect
google.golang.org/grpc v1.70.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)