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

Not interrupt thread when cancel #671

Merged
merged 2 commits into from
Aug 26, 2021
Merged

Conversation

horizonzy
Copy link
Member

fixes: #669

@sofastack-bot sofastack-bot bot added cla:yes question Further information is requested size/XS labels Aug 25, 2021
@@ -113,6 +115,9 @@ public void setFuture(ScheduledFuture<?> future) {

@Override
public void run() {
if (cancel) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加这个状态字段我个人觉得其实没有必要,本身 ScheduledFuture 就会对我们的 task 再包装一层,其中有 state 字段并包含 CANCELLED 状态,说白了,处理机制就和你现在增加的逻辑类似,所以这里可以理解为重复操作

@horizonzy
Copy link
Member Author

horizonzy commented Aug 26, 2021 via email

Copy link
Contributor

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fengjiachun fengjiachun merged commit 7f8ed6c into sofastack:master Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes question Further information is requested size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

使用CliService#resetPeer,导致写metadata文件失败
2 participants