-
Notifications
You must be signed in to change notification settings - Fork 929
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
Imp: destroy invoker smoothly #1045
Conversation
Replace ci icon
53302a3
to
498a8f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里使用原子操作和前面的没什么区别,还是建议使用读写锁来做
This comment has been minimized.
This comment has been minimized.
Codecov Report
@@ Coverage Diff @@
## 1.5 #1045 +/- ##
==========================================
- Coverage 59.53% 59.31% -0.23%
==========================================
Files 259 265 +6
Lines 12737 13137 +400
==========================================
+ Hits 7583 7792 +209
- Misses 4199 4362 +163
- Partials 955 983 +28
Continue to review full report at Codecov.
|
protocol/dubbo/dubbo_invoker.go
Outdated
} | ||
break | ||
} else if times < 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
万一发生什么幺蛾子呢?防御性编程,这里面有日志的。
这边可以用给一个原子操作代表invoker是不是可用状态,然后加一个读写锁,invoke的时候先用原子操作判断是不是可用的,如果可用加读锁,然后再通过原子操作判断一次,如果还可用,调用下面的call,完成后释放读锁。destroy的时候直接把invoker标记为不可用状态,然后阻塞获取写锁,获取成功后然后关闭invoker,释放client就可以了。 |
ef22815
to
fa5c18e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
9420e9e
to
211e22e
Compare
211e22e
to
4a70624
Compare
4a70624
to
d84ece5
Compare
Imp: destroy invoker smoothly
What this PR does:
fix bug: protocol/dubbo/dubbo_invoker.go:DubboInvoker.reqNum should be a atomic number