LocalParticipant awaits track.processor?.onPublish() unbounded inside the publish lock — any slow processor freezes publish/mute for the rest of the session
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- mobile-dev
Hướng nghiên cứu
Read lib/src/participant/local.dart at the audio and video onPublish call sites, along with lib/src/support/serial_runner.dart to understand the publish lock. Then inspect the E2EContainer harness used in #1152 and determine whether onPublish must complete before track.start() or the publish future resolves. Done means a regression test with a never-resolving processor verifies that publishing returns and a subsequent mute completes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-up to #1151 / #1152, filed at @hiroshihorie's request in the approval review on #1152.
Summary
_publishAudioTrack runs entirely inside _publishRunner (the SerialRunner that serializes all publish/unpublish/mute/enable operations), and after the track is already fully published it does an unbounded await on third-party processor code:
- processor await (audio): https://github.com/livekit/client-sdk-flutter/blob/9e05b7987f26de415750b3c12d0e4c889a64f920/lib/src/participant/local.dart#L239-L240
- same pattern (video): https://github.com/livekit/client-sdk-flutter/blob/9e05b7987f26de415750b3c12d0e4c889a64f920/lib/src/participant/local.dart#L519-L520
- the lock: https://github.com/livekit/client-sdk-flutter/blob/9e05b7987f26de415750b3c12d0e4c889a64f920/lib/src/participant/local.dart#L68 with https://github.com/livekit/client-sdk-flutter/blob/9e05b7987f26de415750b3c12d0e4c889a64f920/lib/src/support/serial_runner.dart#L38-L40
TrackProcessor.onPublish is an open extension point, so the SDK is awaiting arbitrary user/plugin code — in livekit_noise_filter's case, a server round-trip — inside its most contended critical section. If that future is slow or never resolves:
- The track is already published and live (
addTrackPublicationhas run, audio/video flows to remote participants). - The
setMicrophoneEnabled(true)/publish*Trackfuture doesn't resolve. - The held
SerialRunnerblocks every subsequentsetMicrophoneEnabled/setCameraEnabled/setSourceEnabled/ unpublish — the user cannot mute a live microphone for the rest of the session.
#1151 was one concrete trigger (the getSid() deadlock, now fixed); this issue is about the amplifier that turned it from "one hung future" into "an unmutable live mic". Any future slow onPublish reproduces the same failure.
Proposal
Detach the processor handoff from the publish critical section: the track is already fully published when onPublish runs, so treat it as asynchronous decoration — run track.processor?.onPublish(room) unawaited with errors logged (or await it after the runner block returns), instead of holding the lock on it. ~10-line diff at the two call sites, plus a regression test (fake processor whose onPublish never resolves; assert publish returns and a subsequent mute completes — same E2EContainer harness as #1152).
Alternative, if completion-before-return must be preserved: bound the await with a timeout + logged warning. Weaker — it converts "forever" into "N seconds of unmutable mic" and picks an arbitrary constant.
One semantics question I'd like your call on before opening the PR: is anything expected to rely on onPublish completing before track.start() / before the publish future resolves? If yes, the timeout variant (or detach-after-start()) is the shape.
Complementary (separate repo, happy to file there too): livekit_noise_filter.onPublish blocks on await room.getSid() just to build its context map — it could send the context immediately and update the sid when it resolves, making the plugin robust on old SDK versions as well.
I'm glad to open the PR for whichever direction you prefer.
- Ngôn ngữ chính
- Dart
- Star
- 421
- Fork
- 260
- Merge trung bình
- 2 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của livekit/client-sdk-flutter
-
`jwtPayload.roomConfiguration` returns null fields for tokens from LiveKit server SDKsCó thể đã có người làm @RaphaelFakhri đã nhận 18 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
livekit/client-sdk-flutter#1243 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
livekit/client-sdk-flutter#1274 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
livekit/client-sdk-flutter#1265 · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
livekit/client-sdk-flutter#1227 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Inbound data packets never delivered while media flows normally (2.13.0, LiveKit Cloud 1.13.7)Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
livekit/client-sdk-flutter#1221 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của livekit/client-sdk-flutter
Issue tương tự
-
Bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
fossasia/badgemagic-app#2034 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
effort
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
berkmancenter/frankly#742 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày