Use fuser instead of lsof command in run-command-shim to prevent run commands hanging due to lsof command hanging - #70
Merged
Conversation
Vivek Lingaiah (viveklingaiah)
requested review from
Nageswara Nandigam (nagworld9) and
Norberto Arrieta (narrieta)
December 17, 2025 22:02
alsanmsft
approved these changes
Jan 8, 2026
Bhaskar Brahma (D1v38om83r)
previously requested changes
Feb 9, 2026
…o dev/vivekl/lsofAlt
Joseph Calev (jscalev)
approved these changes
Aug 19, 2026
Nageswara Nandigam (nagworld9)
approved these changes
Aug 19, 2026
Vivek Lingaiah (viveklingaiah)
dismissed
Bhaskar Brahma (D1v38om83r)’s stale review
August 20, 2026 05:33
Already addressed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem(s):
ICM incidents mentioned here Task 34627514: Investigate RCv2 Linux NOT using lsof command OR using alternatives (lsof command hanging)
Background:
Solution
Sample execution from log:
Simulation of "Text file busy" error (RC binary is open in write mode)
sleeping for 3 seconds before retry, attempt 9 of 10
bash has access mode 'aw' file handle on run-command-handler
sleep has access mode 'aw' file handle on run-command-handler
waiting for process(es) with write handle on run-command-handler
sleeping for 3 seconds before retry, attempt 10 of 10
nohup: failed to run command '/var/lib/waagent/Microsoft.CPlat.Core.RunCommandHandlerLinux-1.3.28/bin/run-command-handler': Text file busy
[stderr]
Successful case (RC executed fine )
2026-08-04T03:14:15.300891Z INFO ExtHandler [Microsoft.CPlat.Core.RunCommandHandlerLinux.RC0803_4-1.3.28] Command: bin/run-command-shim enable
[stdout]
t.CPlat.Core.RunCommandHandlerLinux-1.3.28/bin/run-command-handler enable
time=2026-08-04T03:14:13Z version=v/git@- operation=enable event=start
time=2026-08-04T03:14:13Z version=v/git@- operation=enable message="processing command"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable message="getting required initial variables"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4
time=2026-08-04T03:14:13Z version=v/git@- operation=enable seq=0 seqNum=0
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event=pre-check
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event="comparing seqnum" path=RC0803_4.mrseq
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event="seqnum saved" path=RC0803_4.mrseq
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 message="processing command for extensionName: RC0803_4 and seqNum: 0"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 message="creating json to report status"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 message="reporting status by writing status file locally"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 message="Run Command status was written to file successfully."
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event="reading configuration from /var/lib/waagent/Microsoft.CPlat.Core.RunCommandHandlerLinux-1.3.28/config/RC0803_4.0.settings"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event="read configuration"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event="parsing configuration json"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event="parsed configuration json"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event="validating configuration logically"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event="validated configuration"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 message="extension policy settings file does not exist. No policy applied." error="stat /var/lib/waagent/Microsoft.CPlat.Core.RunCommandHandlerLinux-1.3.28/config/waagent_runtime_policy.json: no such file or directory"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event="creating output directory" path=/var/lib/waagent/run-command-handler/download/RC0803_4/0
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event="created output directory"
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 scriptUri=
time=2026-08-04T03:14:13Z version=v/git@- operation=enable extensionName=RC0803_4 event="executing command" output=/var/lib/waagent/run-command-handler/download/RC0803_4/0
time=2026-