summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKubeEdge Bot <48982446+kubeedge-bot@users.noreply.github.com>2023-09-01 17:36:28 +0800
committerGitHub <noreply@github.com>2023-09-01 17:36:28 +0800
commit5036064115fad46232dee1c8ad5f1f84fde7984b (patch)
tree65380820f11e398cc2cc269e22b456f8385d7883
parentMerge pull request #4972 from WillardHu/automated-cherry-pick-of-#4963-upstre... (diff)
parentedgehub process send twin msg to twingroup directly to avoid the response of ... (diff)
downloadkubeedge-5036064115fad46232dee1c8ad5f1f84fde7984b.tar.gz
Merge pull request #4977 from Shelley-BaoYue/automated-cherry-pick-of-#4702-upstream-release-1.14v1.14.2
Automated cherry pick of #4702: edgehub process send twin msg to twingroup directly to avoid
-rw-r--r--edge/pkg/devicetwin/process.go2
-rw-r--r--edge/pkg/edgehub/process.go8
2 files changed, 10 insertions, 0 deletions
diff --git a/edge/pkg/devicetwin/process.go b/edge/pkg/devicetwin/process.go
index f6ab34e99..5c2197192 100644
--- a/edge/pkg/devicetwin/process.go
+++ b/edge/pkg/devicetwin/process.go
@@ -52,8 +52,10 @@ func (dt *DeviceTwin) distributeMsg(m interface{}) error {
klog.Infof("Send msg to the %s module in twin", dtcommon.CommModule)
confirmMsg := dttype.DTMessage{Msg: model.NewMessage(message.Msg.GetParentID()), Action: dtcommon.Confirm}
if err := dt.DTContexts.CommTo(dtcommon.CommModule, &confirmMsg); err != nil {
+ klog.Errorf("fail to send msg %s to CommModule with err: %+v", confirmMsg.Msg.Header.ID, err)
return err
}
+ return nil
}
if !classifyMsg(&message) {
return errors.New("not found action")
diff --git a/edge/pkg/edgehub/process.go b/edge/pkg/edgehub/process.go
index 05499e3f6..bc08f02bb 100644
--- a/edge/pkg/edgehub/process.go
+++ b/edge/pkg/edgehub/process.go
@@ -73,6 +73,14 @@ func (*defaultHandler) Process(message *model.Message, clientHub clients.Adapter
md = modules.BusGroup
}
+ // TODO: just for a temporary fix.
+ // The code related to device twin message transmission will be reconstructed
+ // by using sendSync function instead of send function.
+ if group == messagepkg.TwinGroupName {
+ beehiveContext.SendToGroup(md, *message)
+ return nil
+ }
+
isResponse := isSyncResponse(message.GetParentID())
if isResponse {
beehiveContext.SendResp(*message)