Commit Graph

109 Commits

Author SHA1 Message Date
Raja Subramanian
e6bbf07089 Comment out memstats worker. (#1239) 2022-12-19 22:37:34 +05:30
Raja Subramanian
80a4dc574a Fallback to participant key if base62 is not available (#1223) 2022-12-13 05:01:23 +05:30
Raja Subramanian
b2df257ac6 base62 encode user provided name/identity. (#1220) 2022-12-10 13:02:31 +05:30
Raja Subramanian
2cad63fe9a Create response channel before sending StartSession (#1208) 2022-12-05 00:11:52 +05:30
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
Raja Subramanian
1e8cc0dc76 Consolidate getMemoryStats (#1122)
* Consolidate getMemoryStats

* Avoid divide-by-0
2022-10-26 09:16:39 +05:30
cnderrauber
441053b7fa add participant id when client reconnect (#988) 2022-09-07 15:56:56 +08:00
cnderrauber
f365481dde unify resume/restart in single/multi node mode (#946) 2022-08-23 18:22:44 +08:00
Ramakrishna Chilaka
677b7c16d1 removing piBy180 from critical path (#821) 2022-07-11 16:02:51 -07:00
Dan McFaul
aa0df2813f deleting nonRtc rooms and fixing race when deleting rooms (#721) 2022-05-27 09:45:22 -06:00
Raja Subramanian
11fb079a4f Catching a few more races reported by go test -race ./... (#713)
* Fix a few more races

* Make sure room store on leave has correct count

* Revert logger change to reduce diff
2022-05-25 07:32:25 +05:30
David Zhao
26700ea135 Add back region when hydrating ParticipantInit. (#648)
It was left out in the previous PR #646
2022-04-24 09:07:33 -07:00
David Zhao
b7d22c4f34 Fix MessageChannel leaks (#646) 2022-04-22 10:53:20 -07:00
David Zhao
59112b9200 Increase default message channel from 200 -> 10k (#638) 2022-04-20 16:34:00 -07:00
Raja Subramanian
8535f3d5b9 Redis AdaptiveStream (#631)
* Redis AdaptiveStream

* Fix adaptive stream while tarnsferring from start session
2022-04-20 10:48:32 +05:30
David Zhao
282e2aed49 Increase frequency of status updates and longer availability threshold (#628)
* Increase frequency of status updates and longer avail. threshold.

* better fix.

* fix room close test failure due to slow peer connection Close

* Perform avg computation more frequently if data has changed
2022-04-19 22:18:00 -07:00
Raja Subramanian
cf627d8bbe Send adaptive stream param in join (#626) 2022-04-19 16:45:35 +05:30
Raja Subramanian
a19ca69f5f Prevent stats update if the deltas are empty (#619)
* Prevent stats update if the deltas are empty

* increase force interval

* static check

* Change max delay to 30 seconds
2022-04-18 22:51:34 +05:30
cnderrauber
7a3e446a65 run StartSession in a goroutine (#614) 2022-04-15 09:36:24 +08:00
Brint E. Kriebel
f8ae219eab Add sort by option to node selector (#599)
* Add sort by option to node selector

Allow the final decision of a selected node to be based on different
sorting options rather than just random.

Add a `sysload`, `cpuload`, `rooms`, `clients`, `tracks`, and
`bytespersec` sorting options to select the appropriate room when
multiple are suitable for the chosen selector.

Add tests for sysload sort_by option

Closes: #598

* NodeSelector: rename "random" selector to "any"

Since the selector introduces limits but the final selection is now
based on the sort by value, the random selector name does not make
sense. Rename this selector to "any" to accurately reflect that it will
select any available no with no additional selection limits.

Allow the old setting "random" to point to the new selector name, but
print a deprecation warning message.
2022-04-14 01:25:36 -07:00
Raja Subramanian
4696503790 Include region in ParticipantInfo (#585) 2022-03-31 14:57:55 +05:30
David Colburn
0b8a180554 Code inspection (#581)
* Code inspection

* fix [4]int64 conversiong
2022-03-30 13:49:53 -07:00
David Zhao
f2556483a3 Re-issue tokens when clients initially connect. (#569)
This ensures if they are disconnected before token is refreshed, they
could reconnect back with a valid token.
2022-03-25 23:55:19 -07:00
David Zhao
51cf626a70 Dump goroutines when possible deadlock is detected (#568) 2022-03-25 23:54:35 -07:00
David Zhao
5920672802 feat: unpublish tracks after publish permissions are revoked. (#545)
* feat: unpublish tracks after publish permissions are revoked.

Uses protocol 7 to indicate client support, otherwise it attempts to
mute the tracks.

Also sends back permissions objects of all participants, and cleaned up
our handling of various permissions attributes.

* fix static check
2022-03-21 00:20:48 -07:00
Mathew Kamkar
cac6d22a72 store cpu load in node stats (#524)
* store cpu load in node stats

* num cpus uint32

* cpu load selector test

* dep update
2022-03-16 14:51:22 -07:00
Raja Subramanian
778d1aa141 utils.AtomicFlag -> atomic.Bool (#466)
* Replacing hand rolled ion-sfu atomic with uber/atomic

* Remove another hand rolled atomic

* utils.AtomicFlag -> atomic.Bool
2022-02-25 12:19:49 +05:30
Raja Subramanian
0170cc1cb6 Staticcheck (#464)
Using `go get -u honnef.co/go/tools/cmd/staticcheck`
Uneaarthed a couple of real bugs
2022-02-25 12:04:08 +05:30
Raja Subramanian
3f38172139 Types for ConnectionID, NodeID, ParticipantKey (#450)
* Types for ConnectionID, NodeID, ParticipantKey

* latest protocol version
2022-02-21 08:52:11 +05:30
David Colburn
7bbd238188 clean up logs and imports (#400) 2022-02-03 14:20:19 -07:00
David Colburn
3d132730f9 replace entire nodeStats object (#393) 2022-01-31 17:09:36 -07:00
David Colburn
32825d2666 clean up WriteRoomRTC (#378)
* clean up WriteRoomRTC

* regenerate
2022-01-26 19:12:39 -07:00
David Zhao
52fc53d325 Issue updated tokens to clients. (#365)
This ensures client reconnect attempts would be successful for long running rooms. It also fixes inaccurate permissions that were set incorrectly when full reconnections take place.
2022-01-23 23:15:49 -08:00
Raja Subramanian
995c1e8676 type aliases -> type definitions (#312)
* type alias -> type definition

* participantSid -> participantID in a comment

* Update protocol
2022-01-03 12:43:58 +05:30
Raja Subramanian
3a9009ae12 type definition of room name (#311)
* WIP commit

* update protocol

* Fixing a test and catching one place where casting was missed

* Fix one more spot which need conversion from livekit.RoomName -> string

* do not covert list
2022-01-02 16:49:16 +05:30
Raja Subramanian
07db1ba726 Some more files with types (#302) 2021-12-30 16:43:20 +05:30
David Zhao
3108ef22ad Ability to set name on Participant (#293) 2021-12-28 00:12:04 -08:00
David Colburn
8f28364842 remove WriteNodeRTC from interface 2021-12-20 16:00:37 -08:00
David Colburn
faa870de3d Move callbacks out of messageRouter (#269)
* move callbacks out of messageRouter

* OCD

* more OCD

* fix forwarder test

* even more OCD

* maximum OCD

* package name collision, copy lock by value
2021-12-17 13:19:23 -08:00
Raja Subramanian
e54ce4f674 Stream Allocator Try 3 (#257)
* Stream Allocator Try 3

Making an intermediate PR to do
- Special treatment for screen share tracks
- When allocating all tracks,
  o try to stream all tracks by starting with the lowest layer
  o multi-pass across tracks to get a more even distribution

Not yet done:
-------------
In deficient state,
o Allocate a specific track on a change
o Steal from other tracks

* Correct sense of managed track

* have to range to copy

* generate

* fix VideoLayers compare

* Use t.simulcasted
2021-12-14 12:48:09 +05:30
Mathew Kamkar
bd42a39117 Include node ID with Prometheus metrics (#251)
* include node id in prometheus metrics

* static prom init and nodeID

* update protocol dep
2021-12-10 15:49:14 -08:00
David Zhao
2d93ccd668 Updated protocol from protocol/proto -> protocol/livekit (#242)
* Updated protocol from protocol/proto -> protocol/livekit

* separate MediaTrack from PublishedTrack
2021-12-08 13:58:38 -08:00
David Colburn
c41384cd09 ActiveRecording (#234)
* ActiveRecording

* regenerate

* update to 0.10.3

* 1.17
2021-12-03 21:40:53 -08:00
Mathew Kamkar
e3c91de594 Configurable limit for number of tracks (#197)
* configurable node track limit

* sample config

* todos

* end of file new line

* default max num tracks

* bandwidth limit

* client message for limit exceeded node

* 10 Gbps default network limit
2021-11-23 15:48:07 -08:00
David Colburn
95e29d3766 Interface updates (#194)
* update interfaces, a bit of cleaning

* regenerate

* return interface for RoomService

* export packetBufferSize

* update router interface

* move participant key into router

* change locks back

* read only room store

* fix server rm locks

* update SendJoinResponse

* clean up imports

* update room messaging

* regenerate
2021-11-15 15:25:50 -06:00
David Zhao
ffb2c50a70 Fixed room API breakage (#190) 2021-11-14 11:18:01 -08:00
Mathew Kamkar
9336a0dab5 health check depends on updated stats (#183) 2021-11-10 14:11:44 -08:00
Mathew Kamkar
94aec3b98d Node updates stats with KeepAlive message to self (#177)
* node sends KeepAlive message to self

* use WriteRTCNodeMessage instead of participants[0]
2021-11-09 17:19:46 -08:00
David Colburn
289ebd32ff Telemetry refactor (#172)
* telemetry refactor

* fix imports

* update protocol
2021-11-08 20:00:34 -06:00
David Colburn
0c8fe361b2 Small refactor (#148)
* small refactor

* extra line

* fix room allocator test

* selector fakes not used

* keep decisions out of router

* put nodeId logic back

* fix room allocator test
2021-10-18 21:49:16 -05:00