forked from zstackio/zstack
-
Notifications
You must be signed in to change notification settings - Fork 0
<fix>[compute]: <description #3183
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
Open
ZStack-Robot
wants to merge
1
commit into
zsv_4.10.28
Choose a base branch
from
sync/tao.gan/res-vm-ZSV-1@@4
base: zsv_4.10.28
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4860,49 +4860,49 @@ public void handle(ErrorCode errCode, Map data) { | |
| }).start(); | ||
| } | ||
|
|
||
| private void handle(final APIRecoverVmInstanceMsg msg) { | ||
| thdf.chainSubmit(new ChainTask(msg) { | ||
| @Override | ||
| public String getSyncSignature() { | ||
| return syncThreadName; | ||
| } | ||
|
|
||
| @Override | ||
| public void run(final SyncTaskChain chain) { | ||
| final APIRecoverVmInstanceEvent evt = new APIRecoverVmInstanceEvent(msg.getId()); | ||
| refreshVO(); | ||
|
|
||
| ErrorCode error = validateOperationByState(msg, self.getState(), SysErrors.OPERATION_ERROR); | ||
| if (error != null) { | ||
| evt.setError(error); | ||
| bus.publish(evt); | ||
| chain.next(); | ||
| return; | ||
| } | ||
|
|
||
| recoverVm(new Completion(msg, chain) { | ||
| @Override | ||
| public void success() { | ||
| evt.setInventory(getSelfInventory()); | ||
| bus.publish(evt); | ||
| chain.next(); | ||
| } | ||
|
|
||
| @Override | ||
| public void fail(ErrorCode errorCode) { | ||
| evt.setError(errorCode); | ||
| bus.publish(evt); | ||
| chain.next(); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| @Override | ||
| public String getName() { | ||
| return "recover-vm"; | ||
| } | ||
| }); | ||
| } | ||
| // private void handle(final APIRecoverVmInstanceMsg msg) { | ||
| // thdf.chainSubmit(new ChainTask(msg) { | ||
| // @Override | ||
| // public String getSyncSignature() { | ||
| // return syncThreadName; | ||
| // } | ||
| // | ||
| // @Override | ||
| // public void run(final SyncTaskChain chain) { | ||
| // final APIRecoverVmInstanceEvent evt = new APIRecoverVmInstanceEvent(msg.getId()); | ||
| // refreshVO(); | ||
| // | ||
| // ErrorCode error = validateOperationByState(msg, self.getState(), SysErrors.OPERATION_ERROR); | ||
| // if (error != null) { | ||
| // evt.setError(error); | ||
| // bus.publish(evt); | ||
| // chain.next(); | ||
| // return; | ||
| // } | ||
| // | ||
| // recoverVm(new Completion(msg, chain) { | ||
| // @Override | ||
| // public void success() { | ||
| // evt.setInventory(getSelfInventory()); | ||
| // bus.publish(evt); | ||
| // chain.next(); | ||
| // } | ||
| // | ||
| // @Override | ||
| // public void fail(ErrorCode errorCode) { | ||
| // evt.setError(errorCode); | ||
| // bus.publish(evt); | ||
| // chain.next(); | ||
| // } | ||
| // }); | ||
| // } | ||
| // | ||
| // @Override | ||
| // public String getName() { | ||
| // return "recover-vm"; | ||
| // } | ||
| // }); | ||
| // } | ||
|
|
||
| private void handle(final APIExpungeVmInstanceMsg msg) { | ||
| final APIExpungeVmInstanceEvent evt = new APIExpungeVmInstanceEvent(msg.getId()); | ||
|
|
@@ -9369,5 +9369,11 @@ public void run(MessageReply reply) { | |
| } | ||
| }); | ||
| } | ||
|
|
||
| private void handle(final APIRecoverVmInstanceMsg msg) { | ||
| // | ||
|
|
||
|
|
||
| } | ||
|
Comment on lines
+9373
to
+9377
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 阻断级问题:APIRecoverVmInstanceMsg handler 为空,可能导致 API 调用无事件返回/超时 当前方法体为空,且没有发布 建议修复(恢复为可工作的 handler) private void handle(final APIRecoverVmInstanceMsg msg) {
- //
+ thdf.chainSubmit(new ChainTask(msg) {
+ @Override
+ public String getSyncSignature() {
+ return syncThreadName;
+ }
+
+ @Override
+ public void run(final SyncTaskChain chain) {
+ final APIRecoverVmInstanceEvent evt = new APIRecoverVmInstanceEvent(msg.getId());
+ refreshVO();
+
+ ErrorCode error = validateOperationByState(msg, self.getState(), SysErrors.OPERATION_ERROR);
+ if (error != null) {
+ evt.setError(error);
+ bus.publish(evt);
+ chain.next();
+ return;
+ }
+
+ recoverVm(new Completion(msg, chain) {
+ @Override
+ public void success() {
+ evt.setInventory(getSelfInventory());
+ bus.publish(evt);
+ chain.next();
+ }
+
+ @Override
+ public void fail(ErrorCode errorCode) {
+ evt.setError(errorCode);
+ bus.publish(evt);
+ chain.next();
+ }
+ });
+ }
+
+ @Override
+ public String getName() {
+ return "recover-vm";
+ }
+ });
}🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
恢复 APIRecoverVmInstanceMsg 的实际执行路径,避免当前“注释实现”造成的功能回归与误导
这里把原实现整段注释掉,但
handleApiMessage()仍然会把APIRecoverVmInstanceMsg路由到该 handler;结合下方新增的空实现(Line 9373-9377),当前 API recover 语义等同于被禁用,且从代码阅读角度非常容易误判“只是临时注释”。建议:要么恢复实现(见下方建议 diff),要么明确删除路由/直接返回错误事件(避免 silent no-op)。
🤖 Prompt for AI Agents