Commit Graph

25 Commits

Author SHA1 Message Date
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
Raja Subramanian
09e3aef859 Check size limits on metadata and name set from client. (#2850)
* Send error response when update metadata fails.

Keeping it simple for the first implementation.
- Send error response only if request_id != 0
- Two kinds of errors notified
  o does not have permissions - NOT_ALLOWED
  o attributes exceeds size limits -  INVALID_ARGUMENT

* Check size limits on metadata and name set from client.

Added a name length limit also.

* check name length in service update participant path also

* limit check in limit config

* update protocol

* longer keys
2024-07-12 09:57:17 +05:30
David Zhao
7a774cc82a Support for participant attributes (#2806)
* Support for participant attributes

* move metadata setters to LocalParticipant

* address feedback

* forward error

* update go mod

* update attributes first
2024-06-19 23:14:19 -07:00
cnderrauber
eca32792b8 Add configuration to limit MaxBufferedAmount for data channel (#2170)
* Add configuration to limit MaxBufferedAmount for data channel

* comment

* Fix generate flags

* fix test

* Don't disconnect slow subscriber
2023-10-23 15:03:58 +08: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
Raja Subramanian
6509bb0325 Add option to issue full reconnect on data channel error. (#2026)
* Add option to issue full reconnect on data channel error.

There are situations where send data packet fails because of "stream
closed". It is unclear when that happens. Seems to be after an
ICERestart after ICE failed and connection type switching to TURN
from ICE.

Once the failure happens, it is not recoverable. Potentially, it is
recoverable, but unclear where the problem lies. Attempts to reproduce
looking at the pattern of failures has been unsuccesful.

In the mean time, adding an option to issue full reconnect
when send data packet fails.

* typo
2023-09-01 17:59:25 +05:30
David Zhao
981fb7cac7 Adding license notices (#1913)
* Adding license notices

* remove from config
2023-07-27 16:43:19 -07:00
cnderrauber
09af509edb Add subscription limits (#1629)
* Add subscription limits

* Add limit to ParticipantParams

* Don't change desired of subscription when reaching limits

* Add subscription limits config

* Revert comment

* solve comments
2023-04-20 14:15:30 +08:00
David Zhao
2851a8ac98 Improved robustness of subscription stack (#1382)
UpdateSubscription had a shortcoming where when it couldn't find the
participant, it ignored the request.

This PR further removes the reliance of current publisher state from
subscribers.
- SubscribeToTrack only takes in a trackID
- Introduced RoomTrackManager to maintain all published tracks to a room
- Added TrackUnpublished event to clearly indicate when a track has been removed
- SubscribeRequested event no longer include information about the publisher
2023-02-06 18:08:26 -08:00
David Zhao
cd6b8b80b9 feat: SubscriptionManager to consolidate subscription handling (#1317)
Added a new manager to handle all subscription needs. Implemented using reconciler pattern. The goals are:

improve subscription resilience by separating desired state and current state
reduce complexity of synchronous processing
better detect failures with the ability to trigger full reconnect
2023-01-24 23:06:16 -08: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
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 Zhao
d8b96ac2c8 Room API to support selective subscriptions 2021-06-23 14:12:51 -07:00
David Zhao
6b63cd5b31 Revamp data channels (#32)
* support for built-in data channels. active speaker updates via data channel

* fixed tests

* update to Pion 3.0.27
2021-04-27 22:02:59 -07:00
David Zhao
2cf2c448be rework multi-node routing, cleaner design for reconnection 2021-01-30 22:24:08 -08:00
David Zhao
71b4673a0a cleanup room state, proper participant termination 2021-01-18 23:44:59 -08:00
David Zhao
d83a1b1af3 automatically cleanup participant redis data 2021-01-18 17:56:48 -08:00
David Zhao
7dcb88343a binding to buffer and correctly forwarding 2021-01-10 16:18:58 -08:00
David Zhao
258f5add2d protocol update: explicit AddTrack to move negotiation initiation to server side.
In order to avoid race conditions with WebRTC, where either side could initiate an offer when tracks have changes, we'll always initiate them from the SFU side.
2021-01-09 23:40:29 -08:00
David Zhao
9897412473 roommanager tests 2020-12-25 22:54:58 -08:00
David Zhao
804b7cb332 JWT token based auth 2020-12-25 22:31:11 -08:00
David Zhao
af0c9dfdf0 server back to working, tho only works when client joins first 2020-12-12 23:05:53 -08:00
David Zhao
9ebfebe2dd simple cli with room APIs 2020-11-03 22:01:54 -08:00
David Zhao
312a4f1def filled in subscriber logic 2020-11-01 20:44:33 -08:00
David Zhao
71d6feedbb peer interfaces and callbacks 2020-10-27 23:41:37 -07:00