Skip to content

Conversation

@gavinltomra
Copy link

@gavinltomra gavinltomra commented Oct 1, 2025

This introduces a new feature to the $edgeAgent:

  • Added direct method call SuspendUpdates (no payload).
    • Calling this will block until the current reconcile loop is completed, then put the agent into a suspended state.
  • Added direct method call ResumeUpdates (no payload).
    • Calling this will put the agent back into normal operation from the suspended state.
  • While in the suspended state, the reconcile loop does not execute.
    • Following the example of the RestartPolicyManager, it will log each time it did nothing due to being suspended.
  • Suspension will automatically time out and normal operation resumes if nobody has called either method for 15 minutes.
    • Calling SuspendUpdates extends the time limit (you get 15 minutes since the latest call).
    • Calling ResumeUpdates ends suspension immediately.
  • Unit tests have been added for the new methods and the backend code.

The changes have been tested on live devices by using the modified agent container in conjunction with standard release components in the host and other containers. Unit tests for edgeAgent have been run locally. Coverage and integration tests have not been run.

The purpose of this feature is to put the device into a special maintenance state where someone can log in remotely or otherwise and manually start/stop docker containers without the agent automatically restarting them (as the agent does not follow the normal docker behaviour for manually stopping containers with a restart policy). Importantly it also avoids needing to stop the entire iotedge runtime, which allows some containers to continue operation while others are under maintenance.

There is a companion feature to this which further improves offline scenarios, but I'll submit that later as I expect it will generate more discussion.

Azure IoT Edge PR checklist:

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines and Best Practices

  • I have read the contribution guidelines.
  • Title of the pull request is clear and informative.
  • Description of the pull request includes a concise summary of the enhancement or bug fix.

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • Description of the pull request includes
    • concise summary of tests added/modified
    • local testing done.

Draft PRs

  • Open the PR in Draft mode if it is:
    • Work in progress or not intended to be merged.
    • Encountering multiple pipeline failures and working on fixes.

Note: We use the kodiakhq bot to merge PRs once the necessary checks and approvals are in place. When it merges a PR, kodiakhq converts the PR title to the commit title, PR description to the commit description, and squashes all the commits in the PR to a single commit. The net effect is that entire PR becomes a single commit. Please follow the best practices mentioned here for the PR title and description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant