Closed Bug 364741 Opened 19 years ago Closed 18 years ago

nsISocketTransport.isAlive() returns false immediately after successful connect

Categories

(Core :: Networking, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: Gijs, Assigned: Biesinger)

References

()

Details

Attachments

(1 file, 1 obsolete file)

As in summary and URL. Because the event is sent before the socket state is changed, and the networking code runs on a different thread, by the time code started from the event breaks in some cases because it checks isAlive() and then fails. In ChatZilla's case, this is biting some patches of us because on some older mozilla versions, the socket doesn't throw an error if you go into offline mode, so we tried to check isAlive, which broke the connection sequence completely for the reason stated.
Summary: nsISocketTransport.isAlive() returns false immediately after succesfull connect → nsISocketTransport.isAlive() returns false immediately after successful connect
Attached patch patch (obsolete) — Splinter Review
Assignee: nobody → cbiesinger
Status: NEW → ASSIGNED
Attachment #249541 - Flags: superreview?(darin.moz)
Attachment #249541 - Flags: review?(darin.moz)
Note that there's an assertion when running the testcase: ###!!! ASSERTION: nsExceptionManager not thread-safe: '_mOwningThread.GetThread() == PR_GetCurrentThread()', file /home/chb/mozilla/xpcom/base/nsExceptionService.cpp, line 97 I'd like to fix that before checking the patch in, even though it doesn't actually cause the test to fail.
Target Milestone: --- → mozilla1.9alpha
Comment on attachment 249541 [details] [diff] [review] patch something seems to be wrong with this testcase...
Attachment #249541 - Flags: superreview?(darin.moz)
Attachment #249541 - Flags: review?(darin.moz)
Biesi: what exactly is wrong with the testcase? :-)
Alright, biesi, are you any further with this? :-)
Comment on attachment 249541 [details] [diff] [review] patch I think we should get this in without tests for now, there are thread-related issues with the testcase
Attachment #249541 - Flags: superreview?(bzbarsky)
Attachment #249541 - Flags: review?(bzbarsky)
Comment on attachment 249541 [details] [diff] [review] patch r+sr=me, but please make sure to get the test fixed and in...
Attachment #249541 - Flags: superreview?(bzbarsky)
Attachment #249541 - Flags: superreview+
Attachment #249541 - Flags: review?(bzbarsky)
Attachment #249541 - Flags: review+
Comment on attachment 249541 [details] [diff] [review] patch I'd like to land the code fix now, because it's a pretty obvious fix. I'll land the test as soon as I can get it fixed.
Attachment #249541 - Flags: approval1.9?
Comment on attachment 249541 [details] [diff] [review] patch a=beltzner, but if the test doesn't land, I'm gonna sic shaver and sayrer on you ;)
Attachment #249541 - Flags: approval1.9? → approval1.9+
Attachment #249541 - Attachment is obsolete: true
Checking in nsSocketTransport2.cpp; /cvsroot/mozilla/netwerk/base/src/nsSocketTransport2.cpp,v <-- nsSocketTransport2.cpp new revision: 1.55; previous revision: 1.54 done leaving open to get a unit test checked in
so the unit test problem is: ###!!! ASSERTION: nsExceptionManager not thread-safe: '_mOwningThread.GetThread() == PR_GetCurrentThread()', file /home/chb/mozilla/xpcom/base/nsExceptionService.cpp, line 97
also PrincipalHolder and then, nsSimpleURI (held by the null principal which gets cycle collected on the main thread during shutdown. did the null principal create that URI on a background thread??)
Comment on attachment 249541 [details] [diff] [review] patch Clearing approval flag since this bug is still open for unit tests. This patch has landed.
Attachment #249541 - Flags: approval1.9+
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Comment on attachment 249541 [details] [diff] [review] patch adding back an approval.
Attachment #249541 - Flags: approval1.9+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: