Replace point-to-point communication between deviceauth and inventory with workflows

Description

When we released Mender 2.4, we were in a hurry as it was a last-minute discovery and decided to have direct communication between deviceauth and inventory to update the device identity, instead of using workflows, which decouples the two microservices and provide retries.

Replace the direct communication with a workflow.

References:

  1. https://github.com/mendersoftware/deviceauth/blob/master/devauth/devauth.go#L224

  2. https://github.com/mendersoftware/deviceauth/blob/master/devauth/devauth.go#L994 

Affects versions

None

Environment

None

Checklist

Activity

Show:

Krzysztof JaśkiewiczNovember 17, 2020 at 10:14 AM

Krzysztof JaśkiewiczOctober 31, 2020 at 9:51 AM
Edited

from my findings it looks like it's working (or not working) as follows:
make_accepted_device method from testutils creates pending device and then accepts it;
deviceauth is starting a couple of workflows; the interesting ones are udpate_device_status
in our case two of them are started - the first one wants to set the status to "pending" and the second one to "accepted";
because the workflows are started almost at the same time there is no way to guarantee which status will be propagated first;
it happens sometimes that the status is being set to "accepted" first and then to "pending" which results in devices being stuck in a pending state in inventory

Krzysztof JaśkiewiczOctober 30, 2020 at 9:00 PM

Fixed

Details

Assignee

Reporter

Story Points

Priority

Days in progress

9

Sprint

Backlog

yes

Zendesk Support

Checklist

Created September 25, 2020 at 4:07 AM
Updated November 17, 2020 at 10:14 AM
Resolved November 17, 2020 at 10:14 AM