RuntimeSchema.getSchema line 140 get stuck

47 views
Skip to first unread message

SuoNayi

unread,
Sep 27, 2017, 7:36:49 PM9/27/17
to protostuff

Version: protostuff v1.5.2
Dependencies:
<dependency>
<groupId>io.protostuff</groupId>
<artifactId>protostuff-api</artifactId>
</dependency>
<dependency>
<groupId>io.protostuff</groupId>
<artifactId>protostuff-collectionschema</artifactId>
</dependency>
<dependency>
<groupId>io.protostuff</groupId>
<artifactId>protostuff-core</artifactId>
</dependency>
<dependency>
<groupId>io.protostuff</groupId>
<artifactId>protostuff-runtime</artifactId>
</dependency>
<dependency>
<groupId>io.protostuff</groupId>
<artifactId>protostuff-runtime-registry</artifactId>
</dependency>

Scenes:
- when I do not use create IncrementalIdStrategy instance I call RuntimeSchema.getSchema(Class<?> type) to get runtime schema it works well.
- when I create the IncrementalIdStrategy instance and deploy my web app into my cluster some http-exec-bio threads get stuck on RuntimeSchema.getSchema(Class<?> type) line 140
here is how I create the IncrementalIdStrategy instance,
new IncrementalIdStrategy.Factory().create()

Hope your feedback and sorry for my poor english.


David Yu

unread,
Sep 27, 2017, 7:49:20 PM9/27/17
to protostuff
If you use multiple instances/jvm, there is no guanantee that the id generated for a certain class is the same across your instances.
I suggest you use ExplicitIdStrategy if you know the classes that need to be serialized ahead of time.  Otherwise, use the default.
some http-exec-bio threads get stuck on RuntimeSchema.getSchema(Class<?> type) line 140
return getSchema(typeClass, ID_STRATEGY);

That doesn't help.  Post your complete stacktrace (a sample that replicates the issue would be better)
here is how I create the IncrementalIdStrategy instance,
new IncrementalIdStrategy.Factory().create()

Hope your feedback and sorry for my poor english.


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



--
When the cat is away, the mouse is alone.
dyuproject.com

SuoNayi

unread,
Sep 27, 2017, 10:16:35 PM9/27/17
to protostuff
thank for your time.
My web application is deployed into a cluster.Some hosts can not response http request so I take lots of thread stacks to see what happens.
Please NOTE that not all hosts behaves badly, just some of them. 
Almost all threads get stuck and stacks seems like the following:

"http-bio-7001-exec-250" #660 daemon prio=5 os_prio=0 tid=0x00007f6005f73800 nid=0x410f in Object.wait() [0x0000000061870000]
   java.lang.Thread.State: RUNNABLE
        at io.protostuff.runtime.RuntimeSchema.getSchema(RuntimeSchema.java:140)
        at com.*.*.util.Serializations$PBSerializerType.toBytes(Serializations.java:112)



在 2017年9月28日星期四 UTC+8上午7:49:20,David Yu写道:


To unsubscribe from this group and stop receiving emails from it, send an email to protostuff+...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages