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

[DHCP] Add try/exception when using psutil.process_iter #19537

Merged
merged 7 commits into from
Jul 16, 2024

Conversation

yaqiangz
Copy link
Contributor

Why I did it

After got running process list by psutil, if some of the processes exited, but invoke name() / cmdline() function of them, it will raise NoSuchProcess exception
Fix issue #19507

Work item tracking
  • Microsoft ADO (number only): 28682744

How I did it

  1. Add try/exception in process execution
  2. Change func get_target_process_cmds to get_target_process for reuse

How to verify it

UT passed

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@yaqiangz yaqiangz marked this pull request as ready for review July 15, 2024 01:43
@yaqiangz yaqiangz requested a review from lguohan as a code owner July 15, 2024 01:43
@yaqiangz yaqiangz changed the title [dhcp] Add try/exception when using psutil.process_iter [DHCP] Add try/exception when using psutil.process_iter Jul 15, 2024
@yaqiangz
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yaqiangz
Copy link
Contributor Author

Hi @yxieca could you please help to merge this PR?

@yxieca yxieca merged commit dc3c045 into sonic-net:master Jul 16, 2024
21 checks passed
@yaqiangz
Copy link
Contributor Author

Hi @yxieca @bingwang-ms could you please approve the backport request?

@yxieca
Copy link
Contributor

yxieca commented Jul 17, 2024

Hi @yxieca @bingwang-ms could you please approve the backport request?

@yaqiangz can you confirm that this change has been tested on 202311 image?

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Jul 18, 2024
)

Why I did it
After got running process list by psutil, if some of the processes exited, but invoke name() / cmdline() function of them, it will raise NoSuchProcess exception
Fix issue sonic-net#19507

How I did it
Add try/exception in process execution
Change func get_target_process_cmds to get_target_process for reuse

How to verify it
UT passed
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202311: #19621

mssonicbld pushed a commit to mssonicbld/sonic-buildimage that referenced this pull request Jul 18, 2024
)

Why I did it
After got running process list by psutil, if some of the processes exited, but invoke name() / cmdline() function of them, it will raise NoSuchProcess exception
Fix issue sonic-net#19507

How I did it
Add try/exception in process execution
Change func get_target_process_cmds to get_target_process for reuse

How to verify it
UT passed
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #19622

mssonicbld pushed a commit that referenced this pull request Jul 18, 2024
Why I did it
After got running process list by psutil, if some of the processes exited, but invoke name() / cmdline() function of them, it will raise NoSuchProcess exception
Fix issue #19507

How I did it
Add try/exception in process execution
Change func get_target_process_cmds to get_target_process for reuse

How to verify it
UT passed
mssonicbld pushed a commit that referenced this pull request Jul 19, 2024
Why I did it
After got running process list by psutil, if some of the processes exited, but invoke name() / cmdline() function of them, it will raise NoSuchProcess exception
Fix issue #19507

How I did it
Add try/exception in process execution
Change func get_target_process_cmds to get_target_process for reuse

How to verify it
UT passed
@yaqiangz
Copy link
Contributor Author

Hi @yxieca @bingwang-ms could you please approve the backport request?

@yaqiangz can you confirm that this change has been tested on 202311 image?

Yes already tested

arun1355492 pushed a commit to arun1355492/sonic-buildimage that referenced this pull request Jul 26, 2024
)

Why I did it
After got running process list by psutil, if some of the processes exited, but invoke name() / cmdline() function of them, it will raise NoSuchProcess exception
Fix issue sonic-net#19507

How I did it
Add try/exception in process execution
Change func get_target_process_cmds to get_target_process for reuse

How to verify it
UT passed
liushilongbuaa pushed a commit to liushilongbuaa/sonic-buildimage that referenced this pull request Aug 1, 2024
)

Why I did it
After got running process list by psutil, if some of the processes exited, but invoke name() / cmdline() function of them, it will raise NoSuchProcess exception
Fix issue sonic-net#19507

How I did it
Add try/exception in process execution
Change func get_target_process_cmds to get_target_process for reuse

How to verify it
UT passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants