summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKubeEdge Bot <48982446+kubeedge-bot@users.noreply.github.com>2023-09-01 17:34:44 +0800
committerGitHub <noreply@github.com>2023-09-01 17:34:44 +0800
commit669cef39bb40fc7ddd5b3fd61f9588542690ef25 (patch)
tree8204ff2686deb41210d8998e6115bdbb186b4e8f
parentMerge pull request #4975 from fisherxu/automated-cherry-pick-of-#4960-upstrea... (diff)
parentedgehub process send twin msg to twingroup directly to avoid the response of ... (diff)
downloadkubeedge-1.12.4.tar.gz
Merge pull request #4979 from Shelley-BaoYue/automated-cherry-pick-of-#4702-upstream-release-1.12v1.12.4
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 0e84550fd..5a6367f74 100644
--- a/edge/pkg/edgehub/process.go
+++ b/edge/pkg/edgehub/process.go
@@ -74,6 +74,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)