xstream multi thread issue.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

xstream multi thread issue.

Huang, Ming
Hi

        We recently updated xstream from from version 1.3.1 to 1.4.7 in our application. We found that the application would sometimes hang. Doing jstack and found that the threads were in the lines of at com.thoughtworks.xstream.core.util.PrioritizedList.iterator(PrioritizedList.java:44). Attached is the full stack.  Can someone help me on this? Do I need to put synchronized around XStream.toXML() call?

Thanks
Ming




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

jstack_log.lsp (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: xstream multi thread issue.

Paul Hammant-3
If you had something that worked before but now does not, can you make a smallest-possible example of that?

1. A java unit test (that does multi-threading)
2. a pom.xml that in some way allows you to go back and forth on:

       <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <!--<version>1.3.1</version>-->
            <version>1.4.7</version>
       </dependency>

3. Maybe bisect through xstream releases to find the one that moved you from working to broken..

- Paul



On Wed, Aug 13, 2014 at 4:49 PM, Huang, Ming <[hidden email]> wrote:
Hi

        We recently updated xstream from from version 1.3.1 to 1.4.7 in our application. We found that the application would sometimes hang. Doing jstack and found that the threads were in the lines of at com.thoughtworks.xstream.core.util.PrioritizedList.iterator(PrioritizedList.java:44). Attached is the full stack.  Can someone help me on this? Do I need to put synchronized around XStream.toXML() call?

Thanks
Ming




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: xstream multi thread issue.

Jörg Schaible-2
In reply to this post by Huang, Ming
Hi Ming,

Huang, Ming wrote:

> Hi
>
> We recently updated xstream from from version 1.3.1 to 1.4.7 in our
> application. We found that the application would sometimes hang. Doing
> jstack and found that the threads were in the lines of at
>
com.thoughtworks.xstream.core.util.PrioritizedList.iterator(PrioritizedList.java:44).
> Attached is the full stack.  Can someone help me on this? Do I need to put
> synchronized around XStream.toXML() call?

Normally no, XStream is thread-safe for concurrent
marshalling/unmarshalling. Unless you process annotations on-the-fly,
XStream documentation contains a lot of warnings about it:

http://xstream.codehaus.org/faq.html#Scalability_Thread_safety
http://xstream.codehaus.org/annotations-tutorial.html#AutoDetect
http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/XStream.html
http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/XStream.html#autodetectAnnotations(boolean)

So, how do you setup your XStream instance? Which Java VM you are using?

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email