Stomp,hawtdispatch,Android: possible jvm bug

49 views
Skip to first unread message

Mario Giammarco

unread,
Mar 26, 2013, 5:15:19 PM3/26/13
to hawtdi...@googlegroups.com
Hello,
I have done an Android client that uses stomp jms to connect to an ActiveMQ server.
Stomp jms uses hawtdispatch to work.
In a 2.3 Android phone it works. On android 2.3 and 4.0 emulator it works.
On some android 4.0 phones like samsung galaxy note and motorola razr it does not work.
I have supposed a dead lock and I have deeply debugged the app.
I have found no deadlock but a thread waiting on libcore.io.posix.poll.
Looking at the stacktrace it is called by org.fusesource.hawtdispatch.internal.NioManager.

Now I see that NioManager has several workarounds to buggy JRE.

So I think:

- for Android 4.0 there is the need of a more powerful workaround;
- or the right workaround is already in the code but is not activated correctly.

Can you please help me?

Thanks,
Mario

Christian Posta

unread,
Mar 26, 2013, 5:26:42 PM3/26/13
to hawtdi...@googlegroups.com
When a thread in the pool isn't servicing events, it will sit in a select() call waiting for IO events as determined by readiness from the OS. There was a bug in the HotSpot VM that is worked around by setting -Dhawtdispatch.workaround-select-spin=true

You can give that a try, but otherwise would be necessary to find out more about what the OS is doing and whether its treating the readiness selectors properly.




--
You received this message because you are subscribed to the Google Groups "hawtdispatch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hawtdispatch...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Christian Posta
twitter: @christianposta

Mario Giammarco

unread,
Mar 26, 2013, 5:54:40 PM3/26/13
to hawtdi...@googlegroups.com
2013/3/26 Christian Posta <christi...@gmail.com>:
> When a thread in the pool isn't servicing events, it will sit in a select()
> call waiting for IO events as determined by readiness from the OS. There was
> a bug in the HotSpot VM that is worked around by setting
> -Dhawtdispatch.workaround-select-spin=true
>

In android setting properties is difficult. Is there another way to do it?
> You received this message because you are subscribed to a topic in the
> Google Groups "hawtdispatch" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/hawtdispatch/GiNkjvdH6lM/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to

Christian Posta

unread,
Mar 26, 2013, 7:37:36 PM3/26/13
to hawtdi...@googlegroups.com
At the moment, that's the only way. We can cook up a patch, or you can submit one that allows setting the selection strategy another way (or maybe Hiram has some suggestions). 


Mario Giammarco

unread,
Mar 28, 2013, 6:19:46 PM3/28/13
to hawtdi...@googlegroups.com
Still debugging. I have modified source code to force the workaround. But now I have discovered that the poll is right when it waits. Infact my app send nothing so it cannot receive a reply.
It sends two packets using hawtdispatch-transport tcp. I do not understand why when I run it with the debugger it sends data. Does the debugger modify java bytecode?
Reply all
Reply to author
Forward
0 new messages