Commit Graph

59 Commits

Author SHA1 Message Date
David Zhao
575b99840a Fixed handling of multiple nodes in region-aware routing 2021-10-10 22:25:29 -07:00
Brint E. Kriebel
822f8c3944 Region Aware node selection fixes and enhancements (#141)
* cli: Allow setting the current node region with flag or env variable

Also add region to "starting LiveKit server" log.

* routing: Add region to node registration

Register the node's region on the selected router so it can be used for
region aware node selection.

Also add the region to the list-nodes output.

* regionaware: Set minDist to zero for the current node

If you don't set the minDist when leaving the loop early for a node that
matches the current region, the minDist value with still be at max. This
causes the the wrong node to be selected if the current node is the
first one the loop passes through.

Add a test that validates this change. The new test fails if this new
change is not in place.
2021-10-10 22:21:37 -07:00
Mathew Kamkar
b212fb9a9e Prometheus counter for Signal/RTC messages (#139) 2021-10-08 12:02:08 -07:00
David Zhao
52e10ea315 handle nil MessageChannel 2021-10-06 22:24:09 -07:00
David Zhao
c745f0a318 Region aware routing (#135)
* Region aware routing

* update config, fix spacing on commented out lines
2021-10-06 21:40:04 -07:00
David Zhao
cdb04248fb Fixed reconnection for single node
It does not yet support resuming the session.
2021-09-24 14:19:23 -07:00
David Zhao
ff47301820 Implements protocol 3 speaker updates (#120)
* Disallow AddTrack from participants that don't have the permission

* Support protocol 3 speaker updates, client info

* update protocol

* Disallow AddTrack from participants that don't have the permission

* increase wait time for GH to pass
2021-09-17 11:47:13 -07:00
David Colburn
abde72a907 Remove room manager from room service (#119)
* start splitting

* room allocator

* remove room manager

* Update pkg/service/roomallocator.go

Co-authored-by: David Zhao <david@davidzhao.com>

Co-authored-by: David Zhao <david@davidzhao.com>
2021-09-17 01:29:29 -05:00
Mathew Kamkar
700a879c0b Redis Router graceful stop (#116)
* prestop and hasparticipants in interface

* add prestop function to existing routers

* fakerouter prestop

* update protocol version

* read lock

* redis router graceful stop

* test fix

* force stop
2021-09-15 13:07:44 -07:00
David Colburn
2a3fb5f0e7 move logging to protocol (#109) 2021-09-09 00:45:42 -07:00
David Zhao
e82d50d717 Send explicit message to clients for mute/unmute. (#107)
* Send explicit message to clients for mute/unmute.

* documentation in config
2021-09-01 21:50:02 -07:00
David Colburn
4044c314b8 participant key (#106)
* participant key

* update fake router

* WriteRTCMessage

* move sink closing

* unused code
2021-08-31 16:14:06 -05:00
David Colburn
1f1eea383f add ctx to interfaces (#105)
* add ctx to interfaces

* use existing context
2021-08-30 20:31:24 -05:00
David Colburn
1e10d440c8 export error 2021-08-30 17:03:39 -07:00
David Colburn
8a44fad307 protocol 0.8 (#95)
* protocol 0.8

* merge new selector
2021-08-27 13:16:33 -05:00
Mathew Kamkar
c437152e2b NodeSelector using system load metric (#94)
* use load when selecting nodes

* Apply suggestions from code review

Co-authored-by: David Zhao <david@davidzhao.com>

* sysload selector test

* wire nodeSelectorFromConfig

* fix tests

* Update pkg/routing/selectorsystemload_test.go

Co-authored-by: David Zhao <david@davidzhao.com>

* dz review: nits

Co-authored-by: David Zhao <david@davidzhao.com>
2021-08-26 15:24:39 -07:00
Mathew Kamkar
f9590afe1a include packet and system info with node stats (#92)
* include packet and system info with node stats

* add more packet and system stats

* revert magefile, clean up system stats error handling

* update procol version

* dz review: error return
2021-08-25 12:04:28 -07:00
Mathew Kamkar
f5466c74e6 list-nodes command action (#87)
* list-nodes command action

* refactor stats into a package

* store existing stats in redis, more refactoring

* dz review: atomic load
2021-08-24 10:14:39 -07:00
David Zhao
834dce543b fix participant APIs when using LocalRouter (#67) 2021-07-22 11:06:23 -07:00
David Colburn
d7be9096c6 persist hidden field to startSession 2021-07-20 17:23:06 -07:00
David Colburn
4bab395ac9 Hidden participants (#65)
Enables hidden recording and/or forwarding participants
2021-07-19 18:33:28 -05:00
hn8
87dfb2b117 log: consistent log key (#60) 2021-07-19 10:28:51 -07:00
David Zhao
a80e8cf69f Enable passing in local IP, refactored IP detection (#48)
* Enable passing in local IP, refactored IP detection

* update docker server instructions
2021-07-11 08:42:11 -07:00
David Zhao
4e6eafa63c for test environments, allow use of internal IP if external IP isn't available 2021-06-30 15:14:58 -07:00
David Zhao
bbf7f83784 Improve integration test reliability, wait for RedisRouter to start 2021-06-09 09:51:44 -07:00
David Zhao
a3228c2ae9 resolve data race conditions, code quality 2021-06-04 14:57:55 -07:00
David Colburn
5baf97e99b imports/inspections 2021-06-04 14:30:10 -05:00
David Colburn
69b94e1142 error logging 2021-06-03 01:57:43 -05:00
David Zhao
0900054c24 ability to disable auto subscribe per participant 2021-05-22 22:54:47 -07:00
David Zhao
0dddc3c0be DeleteRoom now removes all participants in the room 2021-04-21 22:30:29 -07:00
David Zhao
93d10b2640 Manual negotiation and plan-b support 2021-04-16 00:56:25 -07:00
David Zhao
e4238890ff Refactor/cleanup of negotiation path 2021-04-15 17:03:22 -07:00
David Zhao
144351a89a use RWMutex for router channel lookup 2021-04-06 17:16:55 -07:00
David Zhao
f7ed2cee60 RoomService.updateParticipantMetadata, participant permissions 2021-03-16 01:22:21 -07:00
David Zhao
093d99b010 update dependencies, minor fixes 2021-03-15 11:42:57 -07:00
David Zhao
7d02c01fd8 refactor - moved common code to livekit/protocol 2021-03-13 22:01:51 -08:00
David Zhao
ddfddfff53 fixed mismatched codec type in pion, increase message chan buffer to avoid overflow during message handling 2021-03-02 01:10:34 -08:00
David Zhao
a010b618af re-assign node for room if existing node for room is no longer available 2021-02-20 21:09:04 -08:00
David Zhao
b52354623c use hostname instead of MAC address to work with docker environments 2021-02-17 17:51:54 -08:00
David Zhao
99baeb38e4 fix bugs with websocket reconnection, don't re-use redis sinks (#22) 2021-02-15 17:57:01 -08:00
David Zhao
538461d5dc pass client defined metadata from JWT to participant (#17) 2021-02-10 23:13:36 -08:00
David Zhao
38140debdf Admin APIs for participant management (#13)
* stubs for room admin APIs

* room store APIs to persist participants

* participant persistence

* updated protobufs

* implemented APIs to mute/remove/etc

* fixed mute handling
2021-02-10 00:06:32 -08:00
David Zhao
d13a962afd fixed message channel deadlock 2021-02-07 21:58:20 -08:00
David Zhao
c012c742bd fix allowing client negotiations prematurely. 2021-02-05 17:46:52 -08:00
David Zhao
c015e267b0 switch to a single redis subscriber, close properly 2021-02-04 00:25:09 -08:00
David Zhao
320a6c35bf enable explicit reconnect to distinguish between WS disconnect vs PeerConnection disconnect 2021-01-30 23:16:11 -08:00
David Zhao
2cf2c448be rework multi-node routing, cleaner design for reconnection 2021-01-30 22:24:08 -08:00
David Zhao
fe83baa662 reuse the same Participant ID within the same room/session 2021-01-28 01:14:06 -08:00
David Zhao
25d476b8ac fixed multi-node routing, correctly set rtc and signal nodes 2021-01-27 01:16:08 -08:00
David Zhao
61db4f5b66 fixed multi-node so signal node can start sessions 2021-01-26 23:52:55 -08:00