Commit Graph

166 Commits

Author SHA1 Message Date
Raja Subramanian
8cf6cbb826 Structured logging of ParticipantInit (#3279)
* Structured logging of ParticipantInit

* use pointer
2024-12-20 11:12:50 +05:30
Raja Subramanian
23285744ba Server side metrics (#3198)
* mbb WIP

* deps

* WIP

* WIP

* remove unused file

* Switch to enabled

* misc

* deps

* mediatransportutil update

* Typo

* Set ParticipantIdentity in metrics data packets

* use uint32 as JSON decoder does not unmarshal time.Duration
2024-11-25 13:10:48 +05:30
Raja Subramanian
9f25603213 One shot signalling mode (#3188)
* WIP

* comment

* Verify method on LocalParticipant

* cleanup

* clean up

* pass in one-shot-mode to StartSession

* null message source and sink

* feedback and also remove check in ParticipantImpl for one-shot-mode-filtering as a null sink can be used for that
2024-11-21 09:33:28 +05:30
David Zhao
84cb14695f Fix incorrect computation of SecondsSinceNodeStatsUpdate (#3172)
Stats.UpdatedAt is in seconds, but we were loading as nanosecs
2024-11-12 01:13:08 -06:00
Raja Subramanian
365e63230d Some misc clean up. (#3156)
* Some misc clean up.

- Have been seeing counterfeiter warnings about efficiency for a while
  with go:generate declaration multiple times in the same package.
  Address that: https://github.com/maxbrunsfeld/counterfeiter?tab=readme-ov-file#step-2b---add-counterfeitergenerate-directives
- A bit more readability on parameters passed to `sendLeave`

* spacing

* revert some deletes as the complaint was in analytics service only

* Declare in package only once.

Although the warning is about go:generate multiple times when directly
giving the interface to generate, have `go:generate` multiple times in a
package even with `-generate` ends up generating once per invocation.
Once per package is enough to run the generation just once.
2024-11-04 11:26:41 +05:30
Raja Subramanian
49b75e94a6 Consolidate operations on LocalNode. (#3140) 2024-10-25 18:57:23 +05:30
David Zhao
dd7cd7eafc Handle room configuration that's set in the grant itself (#3120)
* Handle room configuration that's set in the grant itself

* ensure refresh token contains updates

* deps

* dep

---------

Co-authored-by: Paul Wells <paulwe@gmail.com>
2024-10-21 23:31:12 -07:00
Paul Wells
8428d5e62b update protocol (#3031)
* update protocol

* test

* cleanup
2024-09-21 17:05:39 -07:00
Raja Subramanian
7df6f86693 Initial plumbing for metrics. (#2950)
* Initial plumbing for metrics.

This implements
- metrics received from participant.
- callback to room.
- room distributes it to all other participants (excluding the sending
  participant).
- other participants forward to client.
- counting metrics bytes in data channel stats

TODO:
  - recording/processing/batching
  - should recording/processing/batching happen on publisher side or
    subscriber side?
  - should metrics be echoed back to publisher?
  - grants to publish/subscribe metrics.

* mage generate

* clear OnMetrics on close

* - CanSubscribeMetrics permission.
- Echo back to sender.

* update deps

* No destination identities for metrics

* WIP

* use normalized timestamp for server injected timestamps

* compile

* debug log metrics batch

* correct comment

* add baseTime to wire

* protocol dep

* Scope metrics forwarding to only participants that a participant is
subscribed to.

Also remove the participant_metrics.go file as it was not doing anything
useful.

* update comment

* utils.ErrorIsOneOf

* couple of more utils.CloneProto
2024-09-19 11:42:31 +05:30
Paul Wells
c371929535 add roommanager service (#2931)
* add roommanager service

* cleanup

* deps

* timeout

* cleanup

* cleanup

* config

* cleanup
2024-08-13 11:00:41 -07:00
cnderrauber
5e1b18dab3 Add option to disable ice lite (#2862)
Some sfu's ice agent implementation has problem
to establish ice connection with lite ice agent,
add option to let client to disble it in server side.
2024-07-15 15:11:46 +08:00
Paul Wells
f1886ece42 update protocol (#2760)
* update protocol

* deps
2024-06-05 19:46:34 -07:00
Alexandr Rastopchin
7d39711084 fix issue 2539, do not kill the keepaliveWorker task when the ping timeout occurs (#2555) 2024-03-07 09:11:36 -08:00
Paul Wells
e5b8e25064 use shared psrpc utils (#2506)
* use shared psrpc utils

* fix

* deps
2024-02-24 00:38:49 -08:00
Paul Wells
9eca035738 revert signal retry (#2413) 2024-01-26 08:14:49 -08:00
Paul Wells
025eb1164c retry signal stream start (#2410) 2024-01-25 15:48:12 -08:00
Paul Wells
cb42c6152c add psrpc redis keepalive (#2398)
* add psrpc redis keepalive

* deps
2024-01-21 06:16:40 -08:00
Paul Wells
fbd488adc3 remove participant key helpers (#2385)
* remove participant key helpers

* deps
2024-01-18 06:46:34 -08:00
Paul Wells
3f2f850bdb clean up legacy rpc (#2384)
* clean up legacy rpc

* cleanup

* cleanup

* cleanup

* tidy

* cleanup

* cleanup
2024-01-14 01:49:26 -08:00
Raja Subramanian
5429edd476 Record node selection reason. (#2346) 2023-12-25 23:03:39 +05:30
David Zhao
3fe124c87f Log cleanup pass (#2285)
* Log cleanup pass

Demoted a bunch of logs to DEBUG, consolidated logs.

* use context logger and fix context var usage

* moved common error types, fixed tests
2023-12-02 15:07:31 -08:00
cfbraun
beecfe3710 Send data (#2270)
* Avoid dropping data packets on local router

* Remove change not needed for PR
2023-12-02 10:29:43 -08:00
Paul Wells
de7532b5a1 split room and participant services (#2205)
* merge

* tidy

* deps
2023-10-31 21:28:21 -07:00
Paul Wells
a5abf61a56 update psrpc (#2188) 2023-10-25 20:20:49 -07:00
Paul Wells
48dba9d589 reduce closing signal stream log level (#2182) 2023-10-24 17:46:07 -07:00
Paul Wells
325e5ca753 add psrpc room service (#2171)
* add psrpc room service

* update deps

* disable by default

* feedback

* config

* test
2023-10-22 22:49:38 -07:00
David Zhao
d6ebc081d5 Use random NodeID instead of MAC based (#2029)
Makes it possible to run multiple instances of livekit-server locally.

Also enables Signal Relay by default as default signal proxy.
2023-09-02 17:36:55 -07:00
David Zhao
981fb7cac7 Adding license notices (#1913)
* Adding license notices

* remove from config
2023-07-27 16:43:19 -07:00
Raja Subramanian
f11a7a229f Remove unnecessary check (#1806) 2023-06-19 16:40:05 +05:30
Raja Subramanian
40f5902d36 Consistently use connID as log tag (#1801) 2023-06-17 21:02:02 +05:30
Raja Subramanian
12db469297 Better tracking of signalling connection. (#1794)
* Better tracking of signalling connection.

- Reason for closing signaling channel.
- ConnectionID attached to request source/response sink

* Tests
2023-06-15 12:53:34 +05:30
Paul Wells
5f3ea75a1e conditionally block on signal relay close (#1722) 2023-05-18 13:53:20 -07:00
Paul Wells
e03b7ef8de start signal relay sessions with the correct node (#1721)
* start signal relay sessions with the correct node

* enable signal relay in multiregion integration test
2023-05-18 12:39:02 -07:00
Raja Subramanian
c79e0ce06f Make signal close async. (#1711)
* Make signal close async.

Left notes about async close in code.

Also reducing retry config timeout
- Timeout to 7.5 seconds (making it 1/4th of current config)
- max retry to 4 seconds
- so, it can do 4 tries now in 7.5 seconds (with retries ending at 0.5
  seconds, 1.5 seconds, 3.5 seconds, 7.5 seconds). The change of max to
  4 seconds is not really needed, but it lined up with 7.5. So, made the
  change.

* update comments a bit
2023-05-16 14:08:17 +05:30
Paul Wells
fc09cacfce increase level for signal stream closed log messages (#1660)
* increase level for signal stream closed log messages

* ensure stream closes on signal close receipt

* cleanup
2023-04-27 08:30:40 -07:00
Paul Wells
f9f89cd7cf close signal with reliable message (#1658)
* close signal with reliable message

* update protocol
2023-04-26 22:59:39 -07:00
David Colburn
ab6c994db4 update protocol/psrpc (#1643)
* update protocol/psrpc

* metadata references
2023-04-21 12:43:20 -07:00
Paul Wells
70041f004f create signalStats from out of order join (#1640) 2023-04-20 03:27:41 -07:00
Paul Wells
422a28551e record signal read failure metrics (#1639) 2023-04-19 15:33:42 -07:00
Paul Wells
96f3aaa587 free signal join response to gc after forwarding (#1619) 2023-04-16 17:38:09 -07:00
Paul Wells
9c64d71e91 update message counter in signal relay (#1620) 2023-04-16 08:40:23 -07:00
Raja Subramanian
ac266fbcd6 Support subscriber_allow_pause connect option (#1612)
* Support subscriber_allow_pause connect option

* optional subscriber_allow_pause field
2023-04-13 17:00:32 +05:30
Paul Wells
eb095db70a Batch signal retries (#1593)
* batch signal retries

* cleanup

* update protocol

* range check message dedup

* update protocol with codegen

* block while draining

* only log send timeouts

* cleanup

* cleanup

* cleanup

* typo

* update config yaml options

* update protocol
2023-04-09 18:18:21 -07:00
Paul Wells
6b0cb33c53 set participant node for redis router in signal service (#1584) 2023-04-05 16:08:25 -07:00
Paul Wells
234f7ea5cb read batched signal messages (#1583)
* batch signal messages

* update protcol
2023-04-05 14:41:52 -07:00
Paul Wells
6636e37664 add prometheus psrpc metrics observer (#1571)
* add prometheus psrpc metrics observer

* record rpc error counts

* update psrpc

* update protocol
2023-04-05 03:50:43 -07:00
Paul Wells
aaab3b8ce8 fix signal client message buffer size (#1561)
* fix signal client message buffer size

* update psrpc dep
2023-03-29 16:34:45 -07:00
David Colburn
191a9e8014 update core to 0.0.5 (#1540)
* update core

* sort imports

* fix typos

* redundant types
2023-03-22 16:53:23 -07:00
Paul Wells
04150c044b count active signal sessions (#1519)
* count active signal sessions

* fix

* generate fake
2023-03-14 17:35:32 -07:00
Paul Wells
54bf7e0dac allow configuring signal message buffer size (#1504)
* allow configuring signal message buffer size

* update psrpc
2023-03-08 17:34:14 -08:00