Open Bug 1602154 Opened 6 years ago Updated 3 years ago

Empty response from POST AJAX request from Datatables

Categories

(Core :: Networking, defect, P5)

71 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: dougherty, Unassigned)

Details

(Whiteboard: [necko-triaged])

Attachments

(3 files)

Attached image Capture.PNG

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0

Steps to reproduce:

Send POST request from web page using Datatables (JQuery plugin https://datatables.net).

Actual results:

Received the response: "No response data available for this request"

Expected results:

Chrome and older versions of Firefox obtain a reponse and update the table data in the browser.

Attached image Works in Chrome

In Chrome v78.0.3904.108 (Official Build) (64-bit) it is working and gets a non-empty reponse

Note this POST request is currently slow. Could Firefox be timing out on this request? Is there a setting to check for this?

Update:

OP was using legacy DataTables API. https://legacy.datatables.net/examples

By switching to current (ver 1.10.20) DataTables API: https://datatables.net/examples the tables do render properly in Firefox ver 72.

So there is something about Firefox and legacy API of datatables that is leading to the failure in recent versions of Firefox.

The legacy AJAX API of DataTables does work in v 68 ESR of Firefox and Chrome but not in the more recent versions of Firefox.

Hi,

I was unable to reproduce this issue on Windows 10 with Firefox Nightly 73.0a1 (2019-12-05) (64-bit) and Firefox Release 71.0 (64-bit). But maybe you can provide me with a bit more info.

Does this issue occur with a fresh profile? you can find the steps here: https://support.mozilla.org/en-US/kb/profile-manager-create-and-remove-firefox-profiles?redirectlocale=en-US&redirectslug=Managing-profiles#w_starting-the-profile-manager

Can you please download Firefox Nightly from here: https://nightly.mozilla.org/ and retest the problem and see if the issue still occurs there as well?

If after doing this you can still reproduce the bug let me know. I've also chosen a component for this bug in hope that someone with more expertise may look at it. We'll await their answer. If you consider that there's another component that's more proper for this case you may change it.

Thanks in advance, Florencia.

Component: Untriaged → DOM: Core & HTML
Flags: needinfo?(dougherty)
Product: Firefox → Core

I found I could consistently generate the issue by putting into my Python POST service a simple time.sleep(20) (that's 20 seconds) and return a static pre-generated JSON after that.

So in this way the only effect on DataTables was the length of time it took to return to the Browser.

I then went into my Advanced Preferences (about:config) in Firefox and increased network.http.network-changed.timeout. Note that the default value is 5 seconds in Firefox for this setting.

I found I needed to increase it only a bit, say up to 35 seconds (have not fine tuned this). Then I could put even time.sleep(100) -- well beyond this sleep time etc and everything still works fine.

My question is what does the setting network.http.network-changed.timeout actually do? What is it for? Why is that interacting with DataTables AJAX processing?

It's especially interesting that essentially anything larger than the default of 5 seconds would allow slow web services (beyond 100 seconds).

So what events or process this parameter settings actually timing? I don't understand it.

Thanks again for your time and help. Let me know if you can provide more information.

Flags: needinfo?(dougherty)

I should mention that I also experimented with DataTables ajax parameter "timeout" and set it up to 300000 ms. It had not effect at all an outcome. It really seems like the Firefox browser setting network.http.network-changed.timeout needs to be increased.

How does this compare with Chrome? Would you know if Chrome have a analogous setting and what is its value?

Quick update. Setting network.http.network-changed.timeout to 10 seconds was also too small. Failed every time. But putting to 20s seemed to be working consistently -- at least in my limited testing.

Attached image Timings error

BTW, the Web Developer tools seems to have a problem inspecting the POST request Timings. See attached image of the error I'm seeing when I try to inspect. That seems to happen even if the response is successful and non-empty.

Since the bug is related to the setting of "network-changed.timeout", I think network team may have more idea on this.

Component: DOM: Core & HTML → Networking

Thanks! I'd love to be able to send a SSCCE for this. Perhaps I can work something up as a very simple Flask server that serves single POST web service that drives a DataTables AJAX. If I do I'll post to this as attachment.

Have Firefox team considered other approaches to this problem such as network-changed.timeout.max-retries or something similar. That way a logger or warning could be given if it fails after 5 seconds, but would keep trying for up to an additional 50 seconds (network-changed.timeout.max-retries = 10).

Otherwise it seems Firefox is missing a market segment around Apps using say RESTful web services that may, because of large data processing, are a bit slow. Those developers creating those kinds of Apps will have no recourse but to use Chrome -- and who would want that?

// > modules/libpref/init/all.js
// The number of seconds to allow active connections to prove that they have
// traffic before considered stalled, after a network change has been detected
// and signalled.
pref("network.http.network-changed.timeout", 5);

If the connections don't do anything for 5 seconds, they are killed.
I'm inclined to close as WONTFIX, but Dragana has the final say here.

Flags: needinfo?(dd.mozilla)
Priority: -- → P3
Whiteboard: [necko-triaged]

Cross-listing issue in DataTables issue tracker to try to help find resolution: https://datatables.net/forums/discussion/59562

What signal could DataTables (or any AJAX request) send periodically so that connections are not dropped if the response is expected to be slower than 5s?

Otherwise a 5s response time seems a bit draconian.

Does Firefox pay any attention to the "timeout" property of an AJAX request?

It seems like it must not, but I want to confirm. For example, as noted above setting the "timeout" property in DataTable's AJAX request had no effect. It seems like Firefox could/should use this parameter to adjust how long it should wait beyond the default network.http.network-changed.timeout before timing out.

Ref: https://datatables.net/forums/discussion/46574/how-to-set-a-different-timeout

Can you say if this behavior documented in recent versions of Firefox?
https://stackoverflow.com/questions/24526201/ajax-does-setting-timeout-always-override-the-browsers-timeout

Flags: needinfo?(dd.mozilla)
Priority: P3 → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: