为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

How can I debug a 50 second delay on XHR response?

  • 1 个回答
  • 2 人有此问题
  • 8 次查看
  • 最后回复者为 lizhenry

more options

I support a webapp within our company. This webapp has existed for a few years, but it has been exhibiting substantial delays recently Firefox users (I think since update 45).

Here is the sequence of events that I see:

1. Page loads, including the index and many javascript files

2. On load completion, the app takes over and performs two parallel XHR requests

3. The server responds to these requests, but Firefox does not fully process them for 50 seconds

4. After 50 seconds, the response is processed and the webapp proceeds as normal.

In debugging this, I used both the Firefox developer tools and wireshark to get packet captures. Wireshark shows the two XHR requests being sent on two connections that were previously used to fetch static content. Both of these requests are returned to the PC running Firefox within about 200ms.

I then looked at the developer tools that displays the network activity. I could see the two XHR requests and both of them showed as being completed (i.e. they were listed with their latency displayed and weren't 'pending'). I clicked on them and, interestingly, they both showed the status code (200 OK), but did not have any response information: no headers or response content. After 50s that content was available in the developer tools display.

One other thing to mention is that while I don't really know the trigger to make this happen, it does only seem to happen when the page is loading the static content. If that content is cached, the problem appears to not happen. With that said, the problem is quite rare and I can't make it occur at will.

At this point, I believe that Firefox is in error. Chrome seems to work fine with this webapp.

Could anyone suggest any additional debugging that I could do on this so that I can get sufficient info to raise a bug for this problem?

Note that I have added some images to show the flow of packets and show the Firefox developer tools during the problem and after the problem. While the problem is going on, you can see that the XHR has completed, but the response information is not present in the right panel. In the second dev-tools image, the request eventually fully completes in Firefox and the response is displayed.

I support a webapp within our company. This webapp has existed for a few years, but it has been exhibiting substantial delays recently Firefox users (I think since update 45). Here is the sequence of events that I see: 1. Page loads, including the index and many javascript files 2. On load completion, the app takes over and performs two parallel XHR requests 3. The server responds to these requests, but Firefox does not fully process them for 50 seconds 4. After 50 seconds, the response is processed and the webapp proceeds as normal. In debugging this, I used both the Firefox developer tools and wireshark to get packet captures. Wireshark shows the two XHR requests being sent on two connections that were previously used to fetch static content. Both of these requests are returned to the PC running Firefox within about 200ms. I then looked at the developer tools that displays the network activity. I could see the two XHR requests and both of them showed as being completed (i.e. they were listed with their latency displayed and weren't 'pending'). I clicked on them and, interestingly, they both showed the status code (200 OK), but did not have any response information: no headers or response content. After 50s that content was available in the developer tools display. One other thing to mention is that while I don't really know the trigger to make this happen, it does only seem to happen when the page is loading the static content. If that content is cached, the problem appears to not happen. With that said, the problem is quite rare and I can't make it occur at will. At this point, I believe that Firefox is in error. Chrome seems to work fine with this webapp. Could anyone suggest any additional debugging that I could do on this so that I can get sufficient info to raise a bug for this problem? Note that I have added some images to show the flow of packets and show the Firefox developer tools during the problem and after the problem. While the problem is going on, you can see that the XHR has completed, but the response information is not present in the right panel. In the second dev-tools image, the request eventually fully completes in Firefox and the response is displayed.
已附加屏幕截图

由efunneko于修改

所有回复 (1)

more options

Hi, this is covered in more detail in bug 1269055 (https://bugzilla.mozilla.org/show_bug.cgi?id=1269055) and it seems to be a problem for certain non-standard server configurations (Possibly with ngnix 1.10) and Firefox 46. The issue is now fixed in Firefox 47, which is planned to release on June 7. But, you can fix this issue now, with this workaround:

Here's a suggestion from our developers for a workaround: Adjust your server side persistent connection timeout to be about 5 seconds longer than the firefox value. Firefox uses 115 seconds for HTTP/1.x and 180 seconds for HTTP/2.

Hope that helps. If you try it, please let us know the result.