Closed Bug 946302 Opened 11 years ago Closed 11 years ago

SocketTransportService Going Offline takes too long

Categories

(Core :: Networking, defect)

25 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: mcmanus, Assigned: mcmanus)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file)

Breakpoint 1, nsSocketTransport::RecoverFromError (this=0x485e43c0) at /home/jessica/workspace/master-new/gecko/netwerk/base/src/nsSocketTransport2.cpp:1372
1372        NS_ASSERTION(NS_FAILED(mCondition), "there should be something wrong");
(gdb) bt
#0  nsSocketTransport::RecoverFromError (this=0x485e43c0) at /home/jessica/workspace/master-new/gecko/netwerk/base/src/nsSocketTransport2.cpp:1372
#1  0x41131aca in nsSocketTransport::OnSocketDetached (this=0x485e43c0, fd=0x46170440) at /home/jessica/workspace/master-new/gecko/netwerk/base/src/nsSocketTransport2.cpp:1816
#2  0x411341cc in nsSocketTransportService::DetachSocket (this=0x40333c50, listHead=0x4035cc00, sock=0x4035cc18)
    at /home/jessica/workspace/master-new/gecko/netwerk/base/src/nsSocketTransportService2.cpp:181
#3  0x41135a28 in nsSocketTransportService::DetachSocketWithGuard (this=0x40333c50, aGuardLocals=true, socketList=0x4035cc00, index=2)
    at /home/jessica/workspace/master-new/gecko/netwerk/base/src/nsSocketTransportService2.cpp:742
#4  0x41135a5a in nsSocketTransportService::Reset (this=0x40333c50, aGuardLocals=true) at /home/jessica/workspace/master-new/gecko/netwerk/base/src/nsSocketTransportService2.cpp:751
#5  0x411358e0 in nsSocketTransportService::Run (this=0x40333c50) at /home/jessica/workspace/master-new/gecko/netwerk/base/src/nsSocketTransportService2.cpp:710
#6  0x4108eb84 in nsThread::ProcessNextEvent (this=0x403025c0, mayWait=true, result=0x45e7ee87) at /home/jessica/workspace/master-new/gecko/xpcom/threads/nsThread.cpp:613
#7  0x41002e0a in NS_ProcessNextEvent (thread=0x403025c0, mayWait=true) at /home/jessica/workspace/master-new/gecko/xpcom/glue/nsThreadUtils.cpp:251
#8  0x4108dbce in nsThread::ThreadFunc (arg=0x403025c0) at /home/jessica/workspace/master-new/gecko/xpcom/threads/nsThread.cpp:251
#9  0x40a7b08e in _pt_root (arg=0x40331780) at /home/jessica/workspace/master-new/gecko/nsprpub/pr/src/pthreads/ptthread.c:204
#10 0x40027114 in __thread_entry (func=0x40a7af49 <_pt_root>, arg=0x40331780, tls=<value optimized out>) at bionic/libc/bionic/pthread.c:217
#11 0x40026c68 in pthread_create (thread_out=<value optimized out>, attr=0xbed99580, start_routine=0x40a7af49 <_pt_root>, arg=0x40331780) at bionic/libc/bionic/pthread.c:357
#12 0x00000000 in ?? ()

And I think I know where the problem is! The problem is in the nsSocketTransportService::mGoingOffline flag.
At boot up, nsSocketTransportService::SetOffline() was called with offline = true, so mGoingOffline and mOffline were both set to true;
when mms data connection got connected, nsSocketTransportService::SetOffline() was called with offline = false, however mGoingOffline remained true.
That is why from the backtrace, we see that nsSocketTransportService::Reset was called.
Is this a bug or something? I can send successfully setting mGoingOffline back to false.


in your case mGoingOffline was processed very slowly because the socket thread (which processes it and resets anything that was currently active) was blocked on a poll() with nothing to do. That's a pretty normal state of affairs for the socket thread, but in this case it had something to do - process those resets and the goingOffline flag. Essentially your mms request was getting into the queue before the resets were processed and then was reset.
Comment on attachment 8342462 [details] [diff] [review]
SocketTransportService Going Offline takes too long

Review of attachment 8342462 [details] [diff] [review]:
-----------------------------------------------------------------

Looks right to me.
Attachment #8342462 - Flags: review?(jduell.mcbugs) → review+
https://hg.mozilla.org/mozilla-central/rev/39a0ab97012e
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: