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

fix E2E_UPDATE_DEVICE_3 failure #1709

Merged
merged 1 commit into from
May 25, 2020

Conversation

luogangyi
Copy link
Member

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind test
/kind failing-test
/kind feature

What this PR does / why we need it:
to solve e2e test occasional failure on E2E_UPDATE_DEVICE_3

Which issue(s) this PR fixes:

Fixes #1627

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@kubeedge-bot kubeedge-bot added the kind/bug Categorizes issue or PR as related to a bug. label May 21, 2020
@kubeedge-bot kubeedge-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 21, 2020
@luogangyi
Copy link
Member Author

/hold

@kubeedge-bot kubeedge-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 21, 2020
@luogangyi
Copy link
Member Author

add some key log to see what happened

@daixiang0
Copy link
Member

daixiang0 commented May 21, 2020

@luogangyi For test, you may pull request in your own repo then you can get admin premission and no need to wait.

@luogangyi
Copy link
Member Author

@luogangyi For test, you may pull request in your own repo then you can get admin premission and no need to wait.

OK, I will try.

@luogangyi luogangyi force-pushed the fix-e2e-modbus branch 8 times, most recently from 58c8018 to 70b8682 Compare May 21, 2020 15:02
@kubeedge-bot kubeedge-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 21, 2020
@luogangyi luogangyi force-pushed the fix-e2e-modbus branch 7 times, most recently from 00aac78 to c4e34dd Compare May 23, 2020 04:28
@kubeedge-bot kubeedge-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 23, 2020
@luogangyi luogangyi force-pushed the fix-e2e-modbus branch 2 times, most recently from 8df7390 to 35a0f1f Compare May 23, 2020 13:49
@luogangyi luogangyi force-pushed the fix-e2e-modbus branch 2 times, most recently from 8630ae3 to 2f924d5 Compare May 24, 2020 15:17
@luogangyi
Copy link
Member Author

I0524 15:31:33.040450   19621 process.go:162] received msg from cloud-hub:{Header:{ID:a4f24ff3-8c65-4f86-a0bc-a2552718c685 ParentID:3cf8b27a-6f74-4c8f-9349-8ff0d7a9889b Timestamp:1590334293040 ResourceVersion:594 Sync:false} Router:{Source:devicecontroller Group:twin Operation:update Resource:membership} Content:map[added_devices:<nil> event_id:8b703d77-9107-490b-bff6-846ce771a0ff removed_devices:[map[description:TISensorTag id:sensor-tag-instance-01 name:sensor-tag-instance-01 twin:map[io-data:map[expected:map[metadata:map[timestamp:1.59033429304e+12] value:1] expected_version:map[cloud:611 edge:0] metadata:map[type:int] optional:false]]]] timestamp:1.59033429304e+12]}
I0524 15:31:33.040563   19621 process.go:286] DeviceTwin receive msg
I0524 15:31:33.040578   19621 process.go:51] Send msg to the CommModule module in twin
I0524 15:31:33.040637   19621 process.go:66] Send msg to the MemModule module in twin
I0524 15:31:33.040651   19621 membership.go:119] Membership event
I0524 15:31:33.040696   19621 communicate.go:36] receive msg commModule
I0524 15:31:33.040707   19621 communicate.go:112] CONFIRM EVENT
I0524 15:31:33.040714   19621 membership.go:257] Begin to remove devices
I0524 15:31:33.040714   19621 communicate.go:117] CommModule deal confirm msgID 3cf8b27a-6f74-4c8f-9349-8ff0d7a9889b
I0524 15:31:33.046380   19621 membership.go:278] Delete document of device sensor-tag-instance-01 successful
I0524 15:31:33.046466   19621 membership.go:304] Remove device sensor-tag-instance-01 successful
I0524 15:31:33.046483   19621 communicate.go:36] receive msg commModule
I0524 15:31:33.089472   19621 process.go:162] received msg from cloud-hub:{Header:{ID:7d08a86f-716b-48a2-ad0e-a1e19612142f ParentID:3cf8b27a-6f74-4c8f-9349-8ff0d7a9889b Timestamp:1590334293089 ResourceVersion:594 Sync:false} Router:{Source:devicecontroller Group:twin Operation:update Resource:membership} Content:map[added_devices:[map[description:TISimplelinkSensorTag id:sensor-tag-instance-02 name:sensor-tag-instance-02 twin:map[temperature-enable:map[expected:map[metadata:map[timestamp:1.590334293089e+12] value:OFF] expected_version:map[cloud:615 edge:0] metadata:map[type:string] optional:false]]]] event_id:53dbb8aa-5595-44f7-b8fe-64e2b2c2ef0a removed_devices:<nil> timestamp:1.590334293089e+12]}
I0524 15:31:33.089556   19621 process.go:162] received msg from cloud-hub:{Header:{ID:82577e60-1427-4449-a352-1238b8267eba ParentID:3cf8b27a-6f74-4c8f-9349-8ff0d7a9889b Timestamp:1590334293089 ResourceVersion:594 Sync:false} Router:{Source:devicecontroller Group:twin Operation:update Resource:device/sensor-tag-instance-02/twin/cloud_updated} Content:map[event_id:91992726-1ce7-4f70-97d3-a417d5a9dbfb timestamp:1.590334293089e+12 twin:map[temperature-enable:map[expected:map[metadata:map[timestamp:1.590334293089e+12] value:ON] expected_version:map[cloud:616 edge:0] metadata:map[type:string] optional:false]]]}
I0524 15:31:33.089593   19621 process.go:286] DeviceTwin receive msg
I0524 15:31:33.089605   19621 process.go:51] Send msg to the CommModule module in twin
I0524 15:31:33.089651   19621 process.go:66] Send msg to the TwinModule module in twin
I0524 15:31:33.089661   19621 twin.go:89] Twin Sync EVENT
I0524 15:31:33.091223   19621 twin.go:107] Begin to update twin of the device sensor-tag-instance-02
E0524 15:31:33.091247   19621 dtcontext.go:81] GetMutex device sensor-tag-instance-02 not exist
I0524 15:31:33.091252   19621 twin.go:166] Begin to deal device twin of the device sensor-tag-instance-02
E0524 15:31:33.091260   19621 twin.go:171] Update twin rejected due to the device sensor-tag-instance-02 is not existed
I0524 15:31:33.091266   19621 twin.go:233] Deal update result of device sensor-tag-instance-02: Build and send result
I0524 15:31:33.091324   19621 twin.go:253] Deal update result of device sensor-tag-instance-02: send result
E0524 15:31:33.091338   19621 dtcontext.go:81] GetMutex device sensor-tag-instance-02 not exist
I0524 15:31:33.091351   19621 process.go:286] DeviceTwin receive msg
I0524 15:31:33.091359   19621 process.go:51] Send msg to the CommModule module in twin
I0524 15:31:33.091404   19621 process.go:66] Send msg to the MemModule module in twin
I0524 15:31:33.091416   19621 membership.go:119] Membership event
I0524 15:31:33.091469   19621 membership.go:166] Add devices to edge group
I0524 15:31:33.091803   19621 communicate.go:36] receive msg commModule
I0524 15:31:33.091814   19621 communicate.go:112] CONFIRM EVENT
I0524 15:31:33.091820   19621 communicate.go:117] CommModule deal confirm msgID 3cf8b27a-6f74-4c8f-9349-8ff0d7a9889b
I0524 15:31:33.091831   19621 communicate.go:36] receive msg commModule
I0524 15:31:33.091839   19621 communicate.go:36] receive msg commModule
I0524 15:31:33.091844   19621 communicate.go:112] CONFIRM EVENT
I0524 15:31:33.091848   19621 communicate.go:117] CommModule deal confirm msgID 3cf8b27a-6f74-4c8f-9349-8ff0d7a9889b
I0524 15:31:33.095152   19621 membership.go:227] Add device twin during first adding device sensor-tag-instance-02
I0524 15:31:33.095166   19621 twin.go:166] Begin to deal device twin of the device sensor-tag-instance-02

Finally, we see what happened.

Device update action immediately after Device create action, and there is no gurantee that edge core will process device create action first.
We should make sure device is created first and then doing update

@daixiang0
Copy link
Member

Good catch!

@kubeedge-bot kubeedge-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 25, 2020
@luogangyi luogangyi force-pushed the fix-e2e-modbus branch 2 times, most recently from 7507b87 to b6e4b87 Compare May 25, 2020 06:07
@kubeedge-bot kubeedge-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 25, 2020
@luogangyi
Copy link
Member Author

luogangyi commented May 25, 2020

/hold cancel

1 similar comment
@luogangyi
Copy link
Member Author

/hold cancel

@kubeedge-bot kubeedge-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 25, 2020
@fisherxu
Copy link
Member

/lgtm
/approve

Thanks for the fix!

@kubeedge-bot kubeedge-bot added the lgtm Indicates that a PR is ready to be merged. label May 25, 2020
@kubeedge-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fisherxu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubeedge-bot kubeedge-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 25, 2020
@kubeedge-bot kubeedge-bot merged commit 1ebebad into kubeedge:master May 25, 2020
kubeedge-bot added a commit that referenced this pull request May 29, 2020
…-upstream-release-1.3

Automated cherry pick of #1709: fix E2E_UPDATE_DEVICE_3 failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky test: E2E_UPDATE_DEVICE_3: Update device instance for modbus protocol
4 participants