Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gtalksms freezes after turning off mobile data connection #8

Closed
GoogleCodeExporter opened this issue Mar 21, 2015 · 16 comments
Closed

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1.Turn off mobile data connection, while gtalksms is running.

What is the expected output? What do you see instead?
Gtalksms freezes, output is "Application GTalkSMS (in process 
com.googlecode.gtalksms) is not responding. [Force close / Wait / Report]"

What version of the product are you using? On what operating system?
Gtalksms 1.3.2 on Android 2.2 (Htc desire)

Please provide any additional information below.
Gtalksms doesn't freeze, when it is running on wifi and after turning wifi off.

Original issue reported on code.google.com by marian.t...@gmail.com on 28 Dec 2010 at 8:54

@GoogleCodeExporter
Copy link
Author

I've a same issue when I stop GTalkSMS and it was running for a long time.
I don't think that is due to mobile data connection but to xmpp protocol.

Can you confirm if the application was running for a long time ? 

Original comment by Florent....@gmail.com on 28 Dec 2010 at 5:37

  • Changed state: Investigating

@GoogleCodeExporter
Copy link
Author

No, it was not running for a long time. May be few hours max. I checked now: 
after restarting phone and turning mobile data off, it freezed :(

Original comment by marian.t...@gmail.com on 28 Dec 2010 at 6:03

@GoogleCodeExporter
Copy link
Author

Ok, can you do the test after few minutes of uptime ?
I'll investigate on it.

Original comment by Florent....@gmail.com on 28 Dec 2010 at 10:28

@GoogleCodeExporter
Copy link
Author

FWIW, this hang seems to be an issue with the smack library.  See my note about 
it in http://code.google.com/p/talkmyphone/issues/detail?id=51#c7.  Discussing 
this before with Christophe-Marie, he indicated he thought the best thing to 
try and do was use 'asmack' as the XMPP library, but I failed to get that going 
due to complexities in the asmack build process (it really is just a set of 
patches to smack itself)

Original comment by skippy.hammond@gmail.com on 28 Dec 2010 at 10:38

@GoogleCodeExporter
Copy link
Author

Here 
http://davanum.wordpress.com/2007/12/31/android-just-use-smack-api-for-xmpp we 
can  find a zip that included smack library with android's patches (I think 
that is asmack version).

Original comment by Florent....@gmail.com on 28 Dec 2010 at 10:54

@GoogleCodeExporter
Copy link
Author

It seems to me, that explanation is in Issue 12.
When I turn off mobile data and after few minutes turn it on, gtalksms is 
running again. The application is not reacting between these two points. I 
didn't tried this before.

Original comment by marian.t...@gmail.com on 29 Dec 2010 at 8:12

@GoogleCodeExporter
Copy link
Author

Issue 12 should stop the app from hanging - but it may not fix the inability to 
disconnect from the mobile network.  What I expect to see now is that the app 
keeps running, but is unable to auto-reconnect when wifi becomes available.

This problem may also be limited to a device and/or version of android - I've 
seen a number of people report it with TMP on a Desire, which is what I have.

Original comment by skippy.hammond@gmail.com on 29 Dec 2010 at 11:05

@GoogleCodeExporter
Copy link
Author

Can you try again with v1.4 please? It's available on market

Original comment by Florent....@gmail.com on 29 Dec 2010 at 11:06

@GoogleCodeExporter
Copy link
Author

I just tried and it is as I predicted - the disconnect never finished, although 
the app remains responsive.  The hang is in XMPPConnection.shutdown(), which is 
called as part of disconnect.  I'll dig a little more for a workaround.

Original comment by skippy.hammond@gmail.com on 30 Dec 2010 at 12:07

@GoogleCodeExporter
Copy link
Author

FWIW, the smack.jar at http://people.apache.org/~dims/android/ is what we are 
currently using (I just grabbed it - the .jar is identical).  FWIW, I don't 
think that has any relationship to 'asmack', which is a far larger set of 
patches.

Original comment by skippy.hammond@gmail.com on 30 Dec 2010 at 1:10

@GoogleCodeExporter
Copy link
Author

asmack binaries can be got from http://code.google.com/p/asmack/ - sadly 
though, I did very quick testing with the .jar from there and got the exact 
same results.  It might be worth testing it more thoroughly as it may work 
better in some other ways - but not in this specific case.

So I knocked up a patch that does the disconnect in its own thread - as the 
comments say, it isn't ideal, but probably better than hanging.  In my testing 
I eventually saw the hung thread terminate up to 30 minutes later, so hopefully 
it will not result in lots of hung threads in the process.  Works for me :)

Original comment by skippy.hammond@gmail.com on 30 Dec 2010 at 7:28

Attachments:

@GoogleCodeExporter
Copy link
Author

if there is now data connection, xmpp never can a clean disconnection.
So XMPPConnection.shutdown() is really necessary ?
This function notify the server that we closing connection but we can't contact 
the server.

Original comment by Florent....@gmail.com on 30 Dec 2010 at 11:06

@GoogleCodeExporter
Copy link
Author

I guess we might want to clean-up the socket etc - but yeah, that may well work 
too.  I wonder which one sucks least? :)

Original comment by skippy.hammond@gmail.com on 30 Dec 2010 at 12:14

@GoogleCodeExporter
Copy link
Author

Actually, a problem with that is that the xmpp stuff keeps at least 3 thread 
alive - a packet reciever, transmitter and a keep-alive watcher - so we would 
probably end up leaking 3 threads instead of one trivial one...

Original comment by skippy.hammond@gmail.com on 30 Dec 2010 at 12:21

@GoogleCodeExporter
Copy link
Author

Original comment by Florent....@gmail.com on 1 Jan 2011 at 9:53

  • Changed state: Fixed

@GoogleCodeExporter
Copy link
Author

Original comment by fschm...@gmail.com on 25 Aug 2011 at 7:51

  • Changed state: Deployed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant