Commit 096840e
committed
publish_live: don't tear down session on a missing/late namespace ack
collect_control_acknowledgements() waits up to 2s for
PUBLISH_NAMESPACE_OK/REQUEST_OK on the control stream; when that read
timed out, publish_live() (draft-14/16 path) propagated the failure
and returned, aborting the whole publish before ever announcing tracks
or entering the await-subscriptions loop. Against a relay that acks
slowly or not at all, this made the stdin/RTMP live-publish path give
up every ~2-4s and get torn down by the caller, even though the
transport itself was perfectly healthy.
A genuine transport failure (the PUBLISH_NAMESPACE write itself
failing, or read_stream reporting a real close/reset) is still fatal.
Only the specific "timed out waiting for stream data" read timeout --
which both transport backends only return when the connection is
otherwise alive -- is now treated as non-fatal: publish_live() logs it
and proceeds to publish tracks and await subscriptions, matching the
live-publish contract that a namespace ack is not a precondition for
staying up.
collect_control_acknowledgements() also now preserves whatever control
bytes it had already parsed-but-deferred or buffered-but-unparsed
before bailing out on that timeout, instead of discarding them. That
way a namespace ack that does show up shortly after publish_live()
moves on isn't lost -- it sits in pending_control_bytes_ and gets
drained by the main control-message loop, which already skips message
types (like PUBLISH_NAMESPACE_OK/REQUEST_OK) it doesn't act on rather
than treating them as a protocol violation.
Adds two regression tests covering: (1) a namespace ack that never
arrives, and (2) one that arrives late during the await-subscribe
loop.1 parent 6083ab4 commit 096840e
2 files changed
Lines changed: 126 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
839 | 839 | | |
840 | 840 | | |
841 | 841 | | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
842 | 850 | | |
843 | 851 | | |
844 | 852 | | |
| |||
3766 | 3774 | | |
3767 | 3775 | | |
3768 | 3776 | | |
| 3777 | + | |
| 3778 | + | |
| 3779 | + | |
3769 | 3780 | | |
3770 | 3781 | | |
3771 | | - | |
3772 | | - | |
3773 | | - | |
| 3782 | + | |
| 3783 | + | |
| 3784 | + | |
| 3785 | + | |
| 3786 | + | |
| 3787 | + | |
| 3788 | + | |
| 3789 | + | |
| 3790 | + | |
| 3791 | + | |
| 3792 | + | |
| 3793 | + | |
| 3794 | + | |
| 3795 | + | |
| 3796 | + | |
| 3797 | + | |
| 3798 | + | |
| 3799 | + | |
| 3800 | + | |
| 3801 | + | |
| 3802 | + | |
| 3803 | + | |
| 3804 | + | |
| 3805 | + | |
| 3806 | + | |
| 3807 | + | |
3774 | 3808 | | |
3775 | | - | |
3776 | | - | |
3777 | | - | |
3778 | 3809 | | |
3779 | 3810 | | |
3780 | 3811 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2615 | 2615 | | |
2616 | 2616 | | |
2617 | 2617 | | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
| 2638 | + | |
| 2639 | + | |
| 2640 | + | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
| 2650 | + | |
| 2651 | + | |
| 2652 | + | |
| 2653 | + | |
| 2654 | + | |
| 2655 | + | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
| 2695 | + | |
| 2696 | + | |
| 2697 | + | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
2618 | 2707 | | |
2619 | 2708 | | |
2620 | 2709 | | |
| |||
0 commit comments