XHR connections aren't closed properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mozilla Firefox |
Invalid
|
Medium
|
|||
firefox (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
In Firefox 14, when I abort an XHR connection, it seems like the connection doesn't get closed properly at the system level, or at least not as quickly as before. Firebug shows the connection as aborted, but the actual network connection seems to still be open.
I'm attaching a sample web server that keeps the connection open (like a long poll request) and a sample HTML file that creates XHR connections and aborts them after a seconds. Using lsof (lsof -i | grep localhost | grep firefox | wc --line) I can see that the number of connections just keeps growing, until Firefox's connection limit is reached.
This causes a problem for automatic testing, which quickly navigates through different pages. Since each page opens up a new connection that doesn't get closed, we run into a situation where the tests starts failing, since it can't connect to the server anymore.
I started seeing this behavior in Firefox 14 (Ubuntu version 14.0.1+
To reproduce the problem, run "python long_poll.py" to start a web server. Then open abort_request.html in Firefox, which will open an XHR connection and abort it once every second. While abort_request.html is running look at the output of "lsof -i | grep localhost | grep firefox | wc --line". In Firefox 11 it stays around 1 and in Firefox 14 it goes up to 15, which is my configured connection limit (network.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: firefox 14.0.1+
ProcVersionSign
Uname: Linux 3.2.0-27-generic x86_64
AddonCompatChec
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
AplayDevices:
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: CONEXANT Analog [CONEXANT Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
ApportVersion: 2.0.1-0ubuntu11
Architecture: amd64
ArecordDevices:
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: CONEXANT Analog [CONEXANT Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
AudioDevicesInUse:
USER PID ACCESS COMMAND
/dev/snd/
BuildID: 20120713224749
Card0.Amixer.info:
Card hw:0 'Intel'/'HDA Intel at 0xf2620000 irq 48'
Mixer name : 'Conexant CX20561 (Hermosa)'
Components : 'HDA:14f15051,
Controls : 21
Simple ctrls : 13
Card29.Amixer.info:
Card hw:29 'ThinkPadEC'
Mixer name : 'ThinkPad EC 7XHT21WW-1.03'
Components : ''
Controls : 1
Simple ctrls : 1
Card29.
Simple mixer control 'Console',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [on]
Channel: Unavailable
Date: Wed Aug 1 15:18:25 2012
ForcedLayersAccel: False
PrefSources: prefs.js
ProcEnviron:
LC_TIME=
TERM=xterm
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
Profiles: Profile0 (Default) - LastVersion=
RelatedPackageV
google-talkplugin 3.2.4.0-1
rhythmbox-mozilla 2.96-0ubuntu4.1
adobe-flashplugin 11.2.202.
totem-mozilla 3.0.1-0ubuntu21
sun-java6-bin 6.26-1oneiric1
RunningIncompat
SourcePackage: firefox
UpgradeStatus: Upgraded to precise on 2011-12-16 (229 days ago)
UserAsoundrc:
pcm.btheadset {
type bluetooth
device 00:0D:3C:6B:34:39
profile "auto"
}
WpaSupplicantLog:
dmi.bios.date: 12/19/2008
dmi.bios.vendor: LENOVO
dmi.bios.version: 6DET38WW (2.02 )
dmi.board.name: 74695RG
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.
dmi.modalias: dmi:bvnLENOVO:
dmi.product.name: 74695RG
dmi.product.
dmi.sys.vendor: LENOVO
Changed in firefox: | |
importance: | Unknown → Medium |
status: | Unknown → New |
Changed in firefox: | |
status: | New → Invalid |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0
Build ID: 20120726160848
Steps to reproduce:
Load up our web application with FF14 on Ubuntu and reload the page a few times ~10 times.
Actual results:
Around the 10th reload, firefox will spin connecting to the web site.
Increasing max_connections _per_server dimishes this problem. After inspecting lsof/netstat, I can see that the connections are being held onto across page reloads, specifically, it appears as though the XHR is being held open across reloads until some built-in timeout is hit (I guess around 2 minutes).
This problem did not occur in FF13, and just trying the FF15 beta, the problem is not occurring there. Since users can install FF14, and it is the default on Ubuntu, it seems like something that should be fixed.
Expected results:
The web site should have loaded immediately, the connections should have been closed when the user hits reload on the page.