Closed
Bug 1239961
Opened 9 years ago
Closed 9 years ago
Do less PR_Poll during shutdown
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox46 | --- | fixed |
People
(Reporter: dragana, Assigned: dragana)
References
Details
Attachments
(1 file, 1 obsolete file)
5.19 KB,
patch
|
mcmanus
:
review+
mcmanus
:
feedback+
|
Details | Diff | Splinter Review |
We can also do less PR_Poll during shutdown.
We do not need to do PR_Connect, PR_ConnectContinue and also PR_Poll during shutdown (at least as soon as nsIOService knows that we are in shutdown)
Also nsHttpConnection::Close does PR_Read to take all data from the socket sockets so that we do not cause TCP RST. We could also skip that.
Only thing left should be PR_Close and less calls that can hang :)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → dd.mozilla
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•9 years ago
|
||
Looking at the code, nsHttpConnectionMgr posts nsHttpConnectionMgr::OnMsgShutdown event on socketThread. This needs to be done before socketThread shuts down, but right after that we can start shutting down thread, I think.
nsHttpConnectionMgr::OnMsgShutdown closes all nsHttpConnection so only connections left are non http connection (e.g. udp).
So DoPollIteration coming after that function will detach all socket (we will do that also during socketThread shutdown) and poll for non http connection (I have not look at them jet).
To optimize this I will only prevent PR_Poll call (and let socketThread call detachSocket while main thread is still busy with some other stuff and not do thate later while main thread is waiting for it).
Assignee | ||
Comment 2•9 years ago
|
||
Attachment #8708286 -
Flags: feedback?(mcmanus)
Assignee | ||
Updated•9 years ago
|
Attachment #8708286 -
Attachment is obsolete: true
Attachment #8708286 -
Flags: feedback?(mcmanus)
Assignee | ||
Comment 3•9 years ago
|
||
Attachment #8708438 -
Flags: feedback?(mcmanus)
Assignee | ||
Comment 4•9 years ago
|
||
Comment 5•9 years ago
|
||
Comment on attachment 8708438 [details] [diff] [review]
bug_1239961_v1.patch
Review of attachment 8708438 [details] [diff] [review]:
-----------------------------------------------------------------
I think all of these changes will really help in aggregate. thanks!
Attachment #8708438 -
Flags: feedback?(mcmanus) → feedback+
Assignee | ||
Updated•9 years ago
|
Attachment #8708438 -
Flags: review?(mcmanus)
Assignee | ||
Comment 6•9 years ago
|
||
The next step would be to limit number of PR_Close calls.
Something like: if we are in shutdown already for more than 3-4min do not call PR_Close let them leak.
Probably this can be done in: http://mxr.mozilla.org/mozilla-central/source/netwerk/base/nsSocketTransport2.cpp#1734
Updated•9 years ago
|
Attachment #8708438 -
Flags: review?(mcmanus) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Keywords: checkin-needed
Comment 8•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in
before you can comment on or make changes to this bug.
Description
•