findForClass.java - reflectorMap.computeIfAbsent Cause the thread to block

190 views
Skip to first unread message

yang yu

unread,
Mar 23, 2021, 12:02:51 AM3/23/21
to mybati...@googlegroups.com
Hello,
I used spring batch-mybatis for stress test. The client has performance bottlenecks and found that findForClass.java-reflectorMap.computeIfAbsent has a lot of thread blocking. What is the likely reason? Is it a configuration problem? thank you very much!

The following is the stack information:
截屏2021-03-23 下午12.01.29.png

Iwao AVE!

unread,
Mar 23, 2021, 12:43:13 AM3/23/21
to mybatis-user
Hello Yang,

It's a known issue of JDK 8.
Upgrading to Java 9 or later is the instant solution if possible.

I'll add a workaround later.

Regards,
Iwao

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mybatis-user/CAKi5b%2BK8mG2A1PgpJvYAcpt-YHAivOtK_nCQwdr--oy-OVeb-Q%40mail.gmail.com.
Message has been deleted

Iwao AVE!

unread,
Apr 9, 2021, 7:10:49 AM4/9/21
to mybatis-user
Hello,

I have committed a workaround.
I'm not sure what your question is, but you can test the fix using the latest 3.5.7-SNAPSHOT.

Regards,
Iwao

On Tue, Mar 23, 2021 at 3:25 PM yang yu <yuy...@pingcap.com> wrote:
Thank you, but I have some questions. I understand that there is a bug in computeIfAbsent in JDK8.
, But JDK8 is a very commonly used version. Have many people mentioned similar issues, but I can’t find similar cases on google. This makes me a little confused.

Iwao AVE! <hara...@gmail.com> 于2021年3月23日周二 下午12:43写道:

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.

yang yu

unread,
Apr 12, 2021, 4:40:07 AM4/12/21
to mybati...@googlegroups.com
When will 3.5.7 be released?

Iwao AVE! <hara...@gmail.com> 于2021年4月9日周五 下午7:10写道:

Iwao AVE!

unread,
Apr 14, 2021, 12:34:24 PM4/14/21
to mybatis-user
3.5.7 will be released soon unless the situation changes.
So, 3.5.7-SNAPSHOT resolved the problem, I guess?

// Iwao


yang yu

unread,
Apr 14, 2021, 1:46:32 PM4/14/21
to mybati...@googlegroups.com
I solved this problem by upgrading jdk9.  I read this PR and I think this problem can also be solved.

Iwao AVE! <hara...@gmail.com>于2021年4月15日 周四00:34写道:

Iwao AVE!

unread,
Apr 14, 2021, 1:50:20 PM4/14/21
to mybatis-user
Ah, I see. Then the JDK bug was the cause, most likely.
Thanks for the follow up!

Reply all
Reply to author
Forward
0 new messages