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

【bug】合并结果集时,偶现NPE异常 #2588

Closed
funnyAnt opened this issue Sep 11, 2020 · 1 comment
Closed

【bug】合并结果集时,偶现NPE异常 #2588

funnyAnt opened this issue Sep 11, 2020 · 1 comment

Comments

@funnyAnt
Copy link
Collaborator

funnyAnt commented Sep 11, 2020

问题

执行需要合并结果集的语句,当并发量大时,偶尔出现Java.lang.NullPointerException

原因分析

多个并发执行时,同一个前端连接会出现下面的并发释放资源冲突问题:

sql1---> outputMergeResult-->source.write 回包给客户端-->dataMergeSvr.clear();
                                                    ---> sql2--->execute()-->clearResources()清理之前的旧资源-->dataMergeSvr.clear();  

从上面可以看出,会有2个线程同时执行 dataMergeSvr.clear(),存在明显的并发问题。

解决方案

加锁,规避并发问题。 参考https://my.oschina.net/u/3736786/blog/3221601,
感谢提供解决方法的同学。

junwen12221 added a commit that referenced this issue Sep 15, 2020
#2588 合并结果集时,偶现NPE异常
@funnyAnt
Copy link
Collaborator Author

funnyAnt commented Oct 1, 2020

关闭

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

No branches or pull requests

1 participant