Commit Graph

2336 Commits

Author SHA1 Message Date
Raja Subramanian
ea2fa30cf8 Plug worker leaks (#2422)
Thank you @paulwe
2024-01-28 23:12:33 +05:30
Raja Subramanian
bcf9fe3f0f Use a participant worker queue in room. (#2420)
* Use a participant worker queue in room.

Removes selectively needing to call things in goroutine from
participant.

Also, a bit of drive-by clean up.

* spelling

* prevent race

* don't need to remove in goroutine as it is already running in the worker

* worker will get cleaned up in state change callback

* create participant worker only if not created already

* ref count participant worker

* maintain participant list

* clean up oldState
2024-01-28 22:10:35 +05:30
Raja Subramanian
38352b6125 Change transport queue. (#2419)
From a channel to OpsQueue. Have seen extreme cases (with a ton of
candidates) overflowing the channel.
2024-01-28 14:28:29 +05:30
Raja Subramanian
b71d373f4a Use Deque in ops queue. (#2418)
* Use Seque in ops queue.

Standardizing some uses
- Change OpsQueue to use Deque so that it can grow/shrink as necessary and
  need not worry about channel getting full and dropping events.
- Change StreamAllocator and TelemetryService to use OpsQueue so that
  they also need not worry about channel size and overflows.

* Address feedback

* delete obvious comment

* clean up
2024-01-28 13:48:30 +05:30
Benjamin Pracht
c2549081c8 Allow creating SRT URL pull ingress (#2416) 2024-01-26 14:03:46 -08:00
Paul Wells
654b05638f update psrpc (#2414) 2024-01-26 10:39:08 -08:00
Paul Wells
9eca035738 revert signal retry (#2413) 2024-01-26 08:14:49 -08:00
cnderrauber
9b4ba2d41d use default max playout delay as chrome (#2411) 2024-01-26 13:32:54 +08:00
cnderrauber
995fddbaf9 Add dynamic playout delay if PlayoutDelay enabled in the room (#2403)
* Add dynamic playout delay

* type for state
2024-01-26 09:33:35 +08:00
aoife cassidy
0ebb861bdf Replace /bin/bash with env call (#2409)
Fixes build on FreeBSD, which uses /usr/local/bin/bash,
and also is just a more idiomatic way to handle shells.
2024-01-25 15:49:36 -08:00
Paul Wells
025eb1164c retry signal stream start (#2410) 2024-01-25 15:48:12 -08:00
renovate[bot]
d5b3bbac61 Update module github.com/livekit/protocol to v1.9.7 (#2337)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-25 15:47:15 -08:00
Raja Subramanian
d3da94c45e Augment LeaveRequest with alternate regions to connect. (#2408)
* Augment LeaveRequest with alternate regions to connect.

* update protocol and issue resume action on close if expected to resume

* use current protocol in tests

* address feedback
2024-01-25 22:22:46 +05:30
Raja Subramanian
43a40eb52d Using minimal TrackInfo when reporing to telemetry. (#2407)
Used the full TrackInfo in my previous PR, but telemetry might be
relying on top level Width/Height. So, make a pared down TrackInfo to
report to telemetry.

Also, correct some spelling/comments.
2024-01-25 10:27:55 +05:30
Raja Subramanian
79cdc2df2e Unify muted and unmuted migration paths. (#2406)
* Unify muted and unmuted migration paths.

If dynacast had disabled all layers, after a migration, the client did
not restart publish (it is akin to muted track). That failed migration
because migration state machine waits for unmuted tracks to be published
(i. e. server has to receive packets).

If a migrating track is in muted state, server does not wait for
packets. It synthesises the published event and catches up later when
packets actually come in.

Just treating all migrations as the erstwhile muted case. Sythesise
publish whether track is muted or not. In the unmuted case, packets
might arrive soon after whereas in muted case, it will depend on when
unmute happens.

This is tricky stuff. So, will need good testing.

* use muted from track info
2024-01-25 01:24:09 +05:30
Denys Smirnov
89c7cec2ad SIP: New protocol for creating participants. (#2404) 2024-01-24 20:01:22 +02:00
Pablo Fuente Pérez
f6608977f0 Fix race condition on Participant.updateState (#2401)
The comparisson between the last and current ParticipantInfo_State wasn't atomic. This sometimes resulted in two calls to onStateChange method for the same participant state. In the end this was reflected in two ACTIVE events being generated for the same participant at exactly the same moment. The fix actually uses the atomic method Swap to properly protect the "compare and set" operation and avoid any race condition.
2024-01-22 17:11:34 -08:00
Paul Wells
867325d120 restore legacy room delete behavior (#2400) 2024-01-22 05:18:12 -08:00
Paul Wells
cb42c6152c add psrpc redis keepalive (#2398)
* add psrpc redis keepalive

* deps
2024-01-21 06:16:40 -08:00
Raja Subramanian
8c932da678 Add ControllerNodeId and SelectionReason to StartSession. (#2396)
* Add ControllerNodeId and SelectionReason to StartSession.

Media node has that information and can log it in context.

* Update deps

* clean up and mage generate

* clean up and fix test

* clean up

* clean up
2024-01-19 17:06:09 +05:30
Jonas Schell
e255b8a51d update readme (#2392) 2024-01-18 15:48:23 -08:00
Paul Wells
fbd488adc3 remove participant key helpers (#2385)
* remove participant key helpers

* deps
2024-01-18 06:46:34 -08:00
Raja Subramanian
899067ba0f Simulation scenarios to disable signal channel on resume (#2389)
* Add a simulation scenario to disconnect signal channel on resume

- Requesting that scenario add that participant to a map with a timeout
  of 5 seconds.
- If a resume (reconnect = 1) happens before the timeout, the signalling
  channel is closed immediately on resume.
- There is a clean up worker which will remove entries from the map when
  they timout.
- The participant is also removed from the map if the disconnect on
  resume is invoked once.

* simulate disconnect signal on resume no messages

* comment

* comment

* Close all retries

* update deps

* abort resume only if simulation applied

* Revert SIP change
2024-01-17 20:44:05 +05:30
Sean DuBois
750d2b5765 Update livekit/protocol (#2390)
Fix API breakage with SIP
2024-01-17 10:03:47 -05:00
Raja Subramanian
f29a28611b Prevent writable race. (#2388)
It is possible that onBindAndConnectedChanged gets executed in such a
way that `writable` does not have the correct value in some very rare
timing case (i. e. case like two executions of the function is racing
and one atomic was read on first exeuction and second execution runs and
sets `writable` and then first execution completes the sets `writable`
to incorrect value based on stale read of first execution).

Prevent it by executing under bind lock.
2024-01-16 12:15:13 +05:30
cnderrauber
5b4848e772 remove dd debug logs (#2387) 2024-01-16 12:07:29 +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
renovate[bot]
1cb4b3e585 Update go deps (#2382)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-13 17:42:34 -08:00
renovate[bot]
2ba4e5c070 Update go deps (#2366)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-12 10:30:22 -08:00
Paul Wells
78bf642d67 record session once (#2381) 2024-01-12 05:55:56 -08:00
Paul Wells
c726cbf2ba increase max session start time bin size (#2380) 2024-01-12 03:49:23 -08:00
Raja Subramanian
bf0e88dea4 Squelch only the log, not the error return. (#2379) 2024-01-12 16:58:23 +05:30
Paul Wells
2fe2a9c9f2 add session start time metric (#2377) 2024-01-11 23:23:51 -08:00
Raja Subramanian
3687396d84 Squelch error logs while waiting for track resolve. (#2376) 2024-01-12 12:16:19 +05:30
Raja Subramanian
dc1b09c757 Update pion/ice to pick some more trace logging (#2374) 2024-01-11 13:57:29 +05:30
Raja Subramanian
6ff7b0faba Pass mock track in track update callback (#2373) 2024-01-11 07:54:26 +05:30
Paul Wells
d70a8e366c inject logger constructor into signal server (#2372)
* inject logger constructor into signal server

* tidy

* tidy

* test
2024-01-10 03:31:54 -08:00
Benjamin Pracht
4e30e1a86d Send telemetry events when switching to COMPLETE state (#2371) 2024-01-08 16:24:53 -08:00
Raja Subramanian
a1ca41a4e1 Skip reporting skew for out-of-order reports (#2369) 2024-01-08 13:11:04 +05:30
renovate[bot]
d8df0f7727 Update module github.com/florianl/go-tc to v0.4.3 (#2365)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-06 22:21:37 -08:00
Paul Wells
b9f9a6b35e force shutdown after second signal (#2364) 2024-01-05 04:16:02 -08:00
Raja Subramanian
32bd75648f Wait for metadata update. (#2363) 2024-01-05 17:07:44 +05:30
renovate[bot]
7049627767 Update module golang.org/x/sync to v0.6.0 (#2361)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-04 22:16:41 -08:00
renovate[bot]
a738062099 Update go deps (#2352)
Generated by renovateBot

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-01-03 16:27:27 -08:00
Paul Wells
a10830a995 add protocol version 12 helper (#2358) 2024-01-03 00:06:43 -08:00
Raja Subramanian
7c8b60431d Update mute if necessary when updating track info. (#2357) 2024-01-02 23:32:43 +05:30
Raja Subramanian
73af5da956 Notify TrackInfo available from red receivers. (#2354)
* Notify TrackInfo available from red receivers.

That kicks off the down track scorer.

* test
2023-12-28 15:50:51 +05:30
Raja Subramanian
2f1a2ff39d Protect against stats getting reset. (#2351)
A reset would make `after` look like it is `before` and the diff will be
large unsigned numbers.
2023-12-28 01:16:59 +05:30
Raja Subramanian
5eea679589 Include packets out-of-order in TrafficStats. (#2350)
PacketsLost may not provide useful if repairs are discounting the loss.
So, out-of-order packets are an indication of loss and maybe subsequent
repair. Note that out-of-order could be just out-of-order by a short
amount of time, but a lot of that happening is not good either.
So, out-of-order could provide a decent view of link quality.
2023-12-27 23:15:24 +05:30
Raja Subramanian
15500d8a18 Add padding and lost packets to traffic stats (#2349)
* Add padding and lost packets to traffic stats

* aggregate padding packets
2023-12-27 17:40:59 +05:30