FlowFuse / device-agent

An agent to run FlowFuse managed instances of Node-RED on devices
Apache License 2.0
15 stars 8 forks source link

Device status in the platform is often out of step #231

Open Steve-Mcl opened 7 months ago

Steve-Mcl commented 7 months ago

Current Behavior

Device status changes are not immediately transmitted to FF upon occurrence. For example, when device agent is SIGTERM'd the status is left shown as "running" on the platform.

e.g. In nr-launcher, when the process exits, we immediately get updated status however the device agent does not have the same tight integration and requires the agent checkin procedure to update the platform

Background

Somewhat related to https://github.com/FlowFuse/device-agent/issues/230 once the device agents launcher and nr-launcher have better parity on audit logging, we will see discrepancies between status and the audit log. For example, the device status will show "running" but the audit log will show "crashed" or "stopped"

Expected Behavior

Device Agent would ideally call checkin when state changes, especially upon start, stop, restart & crash to provide more accurate state info to the platform

Steps To Reproduce

run device agent, kill device agent, see state as "running"

Environment