Open Bug 429728 Opened 16 years ago Updated 2 years ago

XPCOMGC: rework nsHTTPConnectionHandle so it's not finalizer-dependent

Categories

(Core :: Networking: HTTP, defect, P5)

x86
macOS
defect

Tracking

()

People

(Reporter: benjamin, Unassigned)

References

Details

(Whiteboard: [necko-would-take])

Currently in necko, nsHTTPConnectionHandle is used to keep track of "open" connections. The final release of the object will cause the connection to be reclaimed with with the connection manager.

http://mxr.mozilla.org/mozilla/source/netwerk/protocol/http/src/nsHttpConnectionMgr.h#165

This doesn't work so well in XPCOMGC: because objects are not early-finalized, we need some other way to track when a connection is "finished" so that the count of currently open connections (per-host and total) is managed correctly.

I don't know exactly what this means... for the moment I just bumped the prefs so that I don't run into the connection limits, which at least gets me through more of the necko unit tests without livelocking.
Version: unspecified → Trunk
Depends on: 430290
I have a "working" patch for this here: http://hg.mozilla.org/users/bsmedberg_mozilla.com/xpcomgc-patches/index.cgi/file/d03021664afc/http-connection-reclamation

This patch avoids finalizer badness, but doesn't deal with the "fact" that connection reclamation doesn't happen until GC runs. I think we really want client code to explicitly finish connections when they are no longer useful, if possible, but I'm not sure who the "clients" are in this case or how intrusive that kind of change would be.
bah, that's why I hate GC
connection handle hasn't been XPCOMGCFinalizedObject for a very long time.. is this wontfix? it certainly is ref counted though...
Whiteboard: [necko-would-take]
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.