Commit Graph

397 Commits

Author SHA1 Message Date
David Colburn
5d3f644667 update psrpc (#1266) 2022-12-27 13:43:32 -08:00
David Zhao
988858a98a Update dependencies to generic versions (#1259) 2022-12-26 22:29:13 -08:00
David Colburn
976d4ea9db Update psrpc, egressStore interface (#1256)
* Update psrpc, egressStore interface

* psrpc v0.2.0
2022-12-24 00:49:31 -08:00
Raja Subramanian
1a48cc6a8b Track subscription operations per source track. (#1248) 2022-12-23 12:23:26 +05:30
David Colburn
6719a3c714 Updated egress rpc (#1252)
* updated egress rpc

* check if egress exists on stop

* fix static check

* remove old migration code

* rename

* regenerate, update test

* latest staticcheck

* update to psrpc 0.1.0

* fix tests

* dual write rpcs on running egress

* remove unused field

* fix race, change service for egress impl

* return nil if bus is nil

* id -> ids

* add affinityFunc to StartEgress
2022-12-22 21:03:27 -08:00
Raja Subramanian
50e39b9985 Check participant SID also while removing a participant. (#1237) 2022-12-19 22:53:11 +05:30
David Zhao
120335da00 Allow skipping of sending ParticipantJoined analytics event (#1236)
In certain scenarios such as migration, we do not want a duplicate event
to be sent when the participant is reconnecting. The Prometheus metric
should still be updated though.
2022-12-18 22:09:20 -08:00
Raja Subramanian
241a7120f5 ICE config using protocol model (#1233)
* ICE config using protocol model

* use pointers consistently

* protocol pointer

* mage generate
2022-12-19 10:25:08 +05:30
David Zhao
33902a9f2a Do not send ParticipantLeft webhook event unless connected successfully. (#1234)
Fixes #1130
2022-12-18 17:37:55 -08:00
Haibo Chen
8a6c6de1db update name of participant (#1213) 2022-12-15 22:03:59 -08:00
David Zhao
7a1273151f Update to new logging library, using sampling participant logger (#1219) 2022-12-09 00:09:03 -08:00
Raja Subramanian
6bd5504bff Add option to issue full reconnect on a publication error. (#1214)
* Add option to issue full reconnect on a publication error.

Leaving the publication error timeout at 30 seconds as there
are some publications taking long. Also, there are cases
where the peer connection fails after 30 seconds. The peer
connection failure happens after publication error is detected.
But, 30 seconds is a good amount of time for publication to establish.

* prevent recursive lock
2022-12-06 14:46:59 +05:30
David Zhao
e9abb47020 Added logging fields for Ingress & Egress services (#1205) 2022-12-04 21:44:16 -08:00
David Zhao
14de2bec9c Fixed single-node routing breakage. (#1209)
* Fixed single-node routing breakage.

Due to a regression of a previous change, Redis was always enabled even
when no configuration was provided.

* updated go modules
2022-12-04 16:23:35 -08:00
David Zhao
12ae179be2 Configurable RoomService execution timeout (#1206)
* API execution timeout is now configurable

In certain environments, it can take longer than the default 2s to
fully execute API requests. Making execution timeout a configurable option.

* do not expose api to YAML. internal for now.
2022-12-04 10:13:09 -08:00
David Zhao
d146ec7a1f Improve logging messages with RoomService (#1203) 2022-11-30 22:17:28 -08:00
cnderrauber
3c907ed460 Add stats for data channel and signal (#1198)
* Add stats for data channel and signal

* Solve comment
2022-11-30 14:53:19 +08:00
cnderrauber
6711060cdb Add enable loopback candidate option (#1185) 2022-11-23 16:01:36 +08:00
Tom Xiong
e5dabd466e Support redis cluster mode (#1181)
* use redisConfig of protocol instead of redisConfig and use redis of protocol to create redis client to support redis cluster mode too
2022-11-22 10:36:43 -08:00
Benjamin Pracht
2c2c6f9da2 Do not append the stream key to the ingress URL for rtmp (#1167) 2022-11-15 09:19:25 -08:00
David Zhao
e2d775588f Confirm room creation prior to returning from CreateRoom (#1157) 2022-11-09 23:47:41 -08:00
David Zhao
e5d21cb1d9 CreateRoom API to actually create the room on an RTC node (#1155)
Previously, CreateRoom only created the room in storage, but did not
hydrate it on an RTC node. This has caused strange behaviors such as
emptyTimeout not working correctly (#1109).

Also reduced room reap worker to consistently reap rooms. Fixes #241
2022-11-09 23:35:35 -08:00
MaxnSter
7e89ad3fbd RedisStore: make UnlockRoom atomic (#1044)
Co-authored-by: David Zhao <dz@livekit.io>
2022-11-07 23:04:46 -08:00
Benjamin Pracht
c735668f67 Use the redis.UniversalClient interface instead of *redis.Client when interacting with go-redis (#1149)
* Use the redis.UniversalClient interface instead of *redis.Client when interacting with go-redis

* Update protocol to v1.2.1
2022-11-07 17:27:28 -08:00
cnderrauber
0310aa9250 Make sure client get participant info before track fired (#1147) 2022-11-07 14:50:45 +08:00
Benjamin Pracht
9a45b59414 Use ingress specific grants (#1125) 2022-10-26 21:37:36 -07:00
David Colburn
7223d9c132 web egress (#1126) 2022-10-26 13:43:56 -07:00
Mathew Kamkar
26fe910e88 Generated CLI Flags (#1112) 2022-10-25 22:24:08 -07:00
Raja Subramanian
82c2ec8273 Remove named returns from room service. (#1124) 2022-10-26 10:24:13 +05:30
Raja Subramanian
4344af6fd3 Some misc changes (#1107)
- ticker.Stop always
- clean up timer func (if they are added) on participant close
- sequencer test enhancement to add a real packet after a pdding packet
2022-10-20 11:11:45 +05:30
David Colburn
dff5379b78 remove record check on CreateRoom (#1096) 2022-10-17 11:25:20 -07:00
cnderrauber
759e3bb1f2 Refine nat 1to1 mapping setting (#1094)
Now only set mapping when user_external_ip enabled or node_ip is
explicitly set. If multiple local address resolved to same external
ip, only the first one will be mapped to external, avoid candidate
conflict between different clients.
2022-10-17 16:11:52 +08:00
David Zhao
4161768530 Log Service API requests (#1091) 2022-10-17 00:16:54 -07:00
Samuel Humeau
00ec859dd1 Add default handler to 404 (#1088) 2022-10-16 10:30:34 -07:00
David Colburn
78386c4669 Update protocol (#1075)
* update protocol

* auto egress ensure unique filename

* fix tests
2022-10-10 10:38:46 -07:00
David Zhao
1019faa0e6 Cleanup pass through logging (#1073)
* added filtering for noisy pion logs
* demoted some logs to debug
* using consistent trackID / participant / publisher / subscriber terminology
* removed ice candidate log lines, deferring to combined log
2022-10-06 23:48:37 -07:00
Benjamin Pracht
c3120679e6 Make sure CreateIngress returns an empty state (#1069) 2022-10-04 19:23:09 -07:00
Benjamin Pracht
8cf0872ec1 Adopt updated ingress RPC API (#1068) 2022-10-03 11:31:55 -07:00
cnderrauber
716f27c435 Close UDPMux when exit (#1064)
* Close UDPMux when exit

* fix test failed
2022-10-01 09:03:58 +08:00
Raja Subramanian
33f5dbc501 Make strict mode a param (#1054)
So, a wrapping config (like cloud) can skip the strict mode check.
2022-09-29 13:07:32 +05:30
Benjamin Pracht
932af81f34 Update strored version of an active ingress if no ingress server responds (#1031)
This allows deleting and updating an ingress even if the ingress server that was handling it died. It does however mean that if the ingress responds again later, its state will be inconsistent. To somewhat make this less likely, also keep trying contacting the ingress for 1 min in the background.

Also fixing a race where an active deleted Ingress would get recreated on delete because of the update triggered by the ingress session shutdown
2022-09-26 11:16:27 -07:00
David Zhao
5e1912e44c Enable TCP/TURN fallback by default (#1033) 2022-09-22 23:58:07 -07:00
David Colburn
b97d59b8db consolidate room internal (#1030)
* consolidate room internal

* create room internal map

* pipelined room read

* check error

* fix pipelined reads

* clean up after test
2022-09-22 15:59:27 -07:00
David Colburn
803046b882 Auto egress (#1011)
* auto egress

* fix room service test

* reuse StartTrackEgress

* add timestamp

* update prefixed filename explicitly

* update protocol

* clean up telemetry

* fix telemetry tests

* separate room internal storage

* auto participant egress

* remove custom template url

* fix internal key

* use map for stats workers

* remove sync.Map

* remove participant composite
2022-09-21 12:04:19 -07:00
David Zhao
feb47812e7 Allow CORS responses to be cached to allow faster initial connection (#1027) 2022-09-20 23:56:24 -07:00
David Zhao
99cb021e85 Increase max wait for media node to respond. (#1026)
In extreme cases, media nodes could take more than 5s to spin up the
session. Increasing this timeout to 10s reduces the number of disconnections
due to edge cases.
2022-09-20 23:38:58 -07:00
Raja Subramanian
60297b24fd Use UnixMilli (#1009)
* Use UnixMilli

* enhance comment
2022-09-15 19:17:24 +05:30
Raja Subramanian
07c43e0972 Supervisor beginnings (#1005)
* Remove VP9 from media engine set up.

* Remove vp9 from config sample

* Supervisor beginnings

Eventual goal is to have a reconciler which moves state from
actual -> desired. First step along the way is to observe/monitor.
The first step even in that is an initial implementation to get
feedback on the direction.

This PR is a start in that direction
- Concept of a supervisor at local participant level
- This supervisor will be responsible for periodically monitor
  actual vs desired (this is the one which will eventually trigger
  other things to reconcile, but for now it just logs on error)
- A new interface `OperationMonitor` which requires two methods
  o Check() returns an error based on actual vs desired state.
  o IsIdle() returns bool. Returns true if the monitor is idle.
- The supervisor maintains a list of monitors and does periodic check.

In the above framework, starting with list of
subscriptions/unsubscriptions. There is a new module
`SubscriptionMonitor` which checks subscription transitions.
A subscription transition is queued on subscribe/unsubscribe.
The transition can be satisfied when a subscribedTrack is added OR
removed. Error condition is when a transition is not satisfied for
10 seconds. Idle is when the transition queue is empty and
subscribedTrack is nil, i. e. the last transition would have been
unsubscribe and subscribed track removed (unsubscribe satisfied).

The idea is individual monitors can check on different things.
Some more things that I am thinking about are
- PublishedTrackMonitor - started when an add track happens,
  satisfied when OnTrack happens, error if `OnTrack` does not
  fire for a while and track is not muted, idle when there is
  nothing pending.
- PublishedTrackStreamingMonitor - to ensure that a published track
  is receiving media at the server (accounting for dynacast, mute, etc)
- SubscribedTrackStreamingMonitor - to ensure down track is sending
  data unless muted.

* Remove debug

* Protect against early casting errors

* Adding PublicationMonitor
2022-09-15 11:16:37 +05:30
Benjamin Pracht
b0eead22b5 Allow specifying a different RTMP url domain for each ingress (#994) 2022-09-12 14:03:15 -07:00
David Zhao
7e3155dcd6 ForceTCP only for supported clients (#997)
* ForceTCP only for supported clients

Revert back to standard if forceRelay with TLS fails
Don't force TLS unless it's configured

* fix lint
2022-09-09 18:14:36 -07:00