Bug 175185 - [WebRTC] page reload often hangs when webrtc stream is involved
Summary: [WebRTC] page reload often hangs when webrtc stream is involved
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari Technology Preview
Hardware: All All
: P2 Major
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-08-04 04:43 PDT by andj2223
Modified: 2018-03-12 13:53 PDT (History)
5 users (show)

See Also:


Attachments
patch against libwebrtc to enable "immediately start recvonly video upon pageload" behavior. (10.95 KB, patch)
2017-08-04 04:43 PDT, andj2223
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description andj2223 2017-08-04 04:43:23 PDT
Created attachment 317234 [details]
patch against libwebrtc to enable "immediately start recvonly video upon pageload" behavior.

I've noticed flakiness when refreshing pages that use webrtc in Safari. For example, if the page is set up to automatically start receiving a recvonly video stream, and you repeatedly refresh the page, it will eventually stop working.

To reproduce:
Set up a simple webrtc example that immediately causes a recvonly video stream to be played upon pageload.
Repeatedly refresh the page.

Expectation:
The video stream should start playing upon every single refresh.

Actual result:
After about 4-5 refreshes, safari's progress meter in the url bar will freeze at around the 10% mark, and stay there indefinitely. The page will seemingly never reload.

As mentioned, you do need a simple webrtc example that immediately causes a recvonly video stream to be played upon page load.

If you don't have such an example available to you, you have a couple of options that I know of off the top of my head:

I provide a patch to peerconnection_server/peerconnection_client to have this "recvonly upon pageload" behavior here:
https://bugs.chromium.org/p/webrtc/issues/detail?id=7791
I'm not sure if peerconnection_server/client works with webkit's webrtc, so it may require further changes before using it.

Alternatively, you can use the private url that I provided to Alexey P. and Youenn F. in this bug: 
https://bugs.webkit.org/show_bug.cgi?id=175014
Please get that URL from Alexey or Youenn but do not distribute it outside of webkit/Apple.

Additional notes:
You may be hitting the following issue:
https://bugs.chromium.org/p/chromium/issues/detail?id=725038
(more info) https://bugs.chromium.org/p/webrtc/issues/detail?id=7791
libwebrtc commit 355be367c161 fixes that, which you do not appear to have upon my quick glance (it happened after a87675d4 apparently).
Comment 1 Radar WebKit Bug Importer 2017-08-04 09:39:28 PDT
<rdar://problem/33726024>
Comment 2 Jon Lee 2017-09-13 11:21:42 PDT
This will be fixed once we update to the latest libwebrtc.

*** This bug has been marked as a duplicate of bug 176865 ***
Comment 3 Jon Lee 2017-12-20 16:42:38 PST
Deduping. We may want to try to fix this before the libwebrtc update.
Comment 4 youenn fablet 2018-01-15 07:55:58 PST
> After about 4-5 refreshes, safari's progress meter in the url bar will
> freeze at around the 10% mark, and stay there indefinitely. The page will
> seemingly never reload.

I was sometimes able to replay this hang.
Going to a new URL, loading in the same page was ok.
Going back to the test page was also ok.

Sometimes I saw some crashes when reloading but I am not sure this is actually related to WebRTC.
Comment 5 youenn fablet 2018-01-15 08:03:57 PST
(In reply to youenn fablet from comment #4)
> > After about 4-5 refreshes, safari's progress meter in the url bar will
> > freeze at around the 10% mark, and stay there indefinitely. The page will
> > seemingly never reload.
> 
> I was sometimes able to replay this hang.
> Going to a new URL, loading in the same page was ok.
> Going back to the test page was also ok.
> 
> Sometimes I saw some crashes when reloading but I am not sure this is
> actually related to WebRTC.

As detailed in rdar://problem/33726024, one is related to WebRTC. I filed https://bugs.webkit.org/show_bug.cgi?id=181649 for that purpose.
Comment 6 youenn fablet 2018-03-12 13:53:51 PDT
andj2223, given bug 181649 is done, I am closing this bug.
Let me know if you still experience this issue in latest releases.