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

在并发的对一个Connection进行建连和主动通过close时可能阻塞IO线程 #96

Closed
dbl-x opened this issue Oct 10, 2018 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dbl-x
Copy link
Contributor

dbl-x commented Oct 10, 2018

Describe the bug

  1. RunStateRecordedFutureTask#getAfterRun方法可能会阻塞在super.get()上,如果RunStateRecordedFutureTask执行的Callable被阻塞
  2. Callable实际执行的是ConnectionPoolCall,执行建连操作,可能会阻塞在获取netty的建连结果上
  3. 那么可能出现ConnectionPoolCall再等待IO线程建连,而IO线程在等待ConnectionPoolCall的执行结果,出现死锁

Expected behavior

Actual behavior

  • IO线程被阻塞在获取callable的结果上,建连的线程被阻塞在获取建连的结果上

image

image

Steps to reproduce

  • 并发执行主动的建连和close操作,使channelInactive时拿到的task对象为后续建连产生的新的task对象,且这个对象的hasRun状态已经为true但是callable未执行

image

Minimal yet complete reproducer code (or GitHub URL to code)

Environment

  • SOFABolt version: 1.4.x 1.5.x
  • JVM version (e.g. java -version):
  • OS version (e.g. uname -a):
  • Maven version:
  • IDE version:
@dbl-x dbl-x added the bug Something isn't working label Oct 10, 2018
@dbl-x dbl-x added this to the 1.5.2 release milestone Oct 10, 2018
@dbl-x dbl-x self-assigned this Oct 10, 2018
dbl-x added a commit that referenced this issue Oct 10, 2018
dbl-x added a commit that referenced this issue Oct 11, 2018
* fix #96

* close Connection in RpcHeartbeatTrigger but do not change the closed state of Connection

* close channel in RpcHeartbeatTrigger

* add log

* code format

* fix ci exception in jdk1.6
@dbl-x dbl-x modified the milestones: 1.5.2 release, 1.4.5 release Oct 11, 2018
@dbl-x dbl-x closed this as completed Oct 11, 2018
dbl-x added a commit that referenced this issue Oct 18, 2018
@dbl-x dbl-x modified the milestones: 1.4.5 release, 1.5.2 release Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant