[SERVER-36431] Powercycle should check for existence of a process before accessing it's attributes Created: 03/Aug/18 Updated: 29/Oct/23 Resolved: 13/Aug/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Testing Infrastructure |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jonathan Abrahams | Assignee: | Jonathan Abrahams |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Backport Requested: |
v4.0, v3.6
|
||||||||||||||||
| Sprint: | TIG 2018-08-27 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Linked BF Score: | 46 | ||||||||||||||||
| Story Points: | 1 | ||||||||||||||||
| Description |
|
It's possible then when iterating over a list of processes that the process could finish before it's accessed:
An additional check should be added
|
| Comments |
| Comment by Githook User [ 13/Aug/18 ] |
|
Author: {'name': 'Jonathan Abrahams', 'email': 'jonathan@mongodb.com', 'username': 'hptabster'}Message: |
| Comment by Max Hirschhorn [ 04/Aug/18 ] |
|
Calling psutil.pid_exists() and then calling psutil.Process.name() "very quickly" is still a race. We should instead just continue if proc.name() raises a psutil.NoSuchProcess exception as we only care about getting the list of live processes matching self.name. |