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

Is_Installed Step runs multiple times in swupdatev2 handler #631

Open
agreentree-dmc opened this issue Jun 4, 2024 · 4 comments
Open

Is_Installed Step runs multiple times in swupdatev2 handler #631

agreentree-dmc opened this issue Jun 4, 2024 · 4 comments
Assignees

Comments

@agreentree-dmc
Copy link

I am using ADU v1.1.0 with the swupdatev2 handler, with a deployment script, based heavily on the provided example script.

The update agent invokes the script with the argument --action-is-installed several times when the is installed step reports a 901 (ADUC_Result_IsInstalled_NotInstalled) result code. When the is installed action reports a 900 (ADUC_Result_IsInstalled_Installed) result code, the action does not repeat.
You can see the handler invoke the script multiple times with the --action-is-installed argument in the logs section below.

Expected Behavior

Is invoking it multiple times expected behavior? I would expected the script is invoked with the --action-is-installed argument only once regardless of if the result code is 900 or 901 and would consider this a bug. If this is expected, is there any documentation available so I can better understand how many times each action is invoked based on the result codes?

Current Behavior

Swupdatev2 handler invokes the install script with the argument --action-is-installed multiple times if the result code is 901.

Steps to Reproduce

  1. Install ADU v1.1.0 with swupdate step handler enabled.
  2. Run an update that invokes a script which runs a function when the --action-is-installed argument is passed. Return a 901 result code from the function.
  3. Observe the function is executed multiple times.

Device Information

  • Host OS: Linux OS generated with Yocto.
  • Architecture: arm64
  • Provisioning Method: DPS
  • DU Agent Version (run 'sudo -u adu /usr/bin/AducIotAgent -v'): 1.1.0

Logs

Shown here is the example of deploying an update where the installed criteria is not met. You can see the script is called multiple times (distinct process ids) with the --action-is-installed argument. This is all for a single run of the update.
image

@eshashah-msft eshashah-msft self-assigned this Jun 6, 2024
@agreentree-dmc
Copy link
Author

@eshashah-msft Curious if you had time to take a look at this? Were you able to reproduce this issue?

@Nox-MSFT
Copy link
Contributor

@agreentree-dmc , This is the expected behavior. The --action-is-installed option is often used to determine whether any subsequent tasks (download, install, apply) should be performed. This is primarily for performance optimization.

For example, if a 'step' is already 'installed', it usually doesn't make sense to perform the download action.

@agreentree-dmc
Copy link
Author

@Nox-MSFT Okay - thanks for following up. I definitely expect the is-installed action to run each time, but just not expect it to run several times in a row. Just to clarify, the is-installed action runs multiple times in quick succession without any other steps running, is that expected?

@agreentree-dmc
Copy link
Author

@Nox-MSFT - If you have a moment, you please confirm that the behavior described matches what you are expecting?

@Nox-MSFT Okay - thanks for following up. I definitely expect the is-installed action to run each time, but just not expect it to run several times in a row. Just to clarify, the is-installed action runs multiple times in quick succession without any other steps running, is that expected?

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

No branches or pull requests

3 participants