Handle ZombieProcess and NoSuchProcess from psutil for OSX systems#1599
Open
flipdazed wants to merge 5 commits intoeth-brownie:masterfrom
Open
Handle ZombieProcess and NoSuchProcess from psutil for OSX systems#1599flipdazed wants to merge 5 commits intoeth-brownie:masterfrom
ZombieProcess and NoSuchProcess from psutil for OSX systems#1599flipdazed wants to merge 5 commits intoeth-brownie:masterfrom
Conversation
Author
|
This function shouldn't have test cases or documentation as it's so niche it would add code bloat |
ZombieProcess and NoSuchProcess from psutil
ZombieProcess and NoSuchProcess from psutilZombieProcess and NoSuchProcess from psutil when connecting rpc
ZombieProcess and NoSuchProcess from psutil when connecting rpcZombieProcess and NoSuchProcess from psutil for OSX systems
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.
…://github.com//issues/1588
What I did
I added a check to ensure that a process in is actually an active process. There are many circumstances in OSX where one can have hanging/zombie processes. In this instance, the process name does not exist as the process has been terminated. This causes a really confusing
psutilerror for the userRelated issue: #1588
How I did it
As with many bugs, this fix is quite simple when the origin of the bug has been pinned down. The following code
brownie/brownie/network/rpc/__init__.py
Lines 253 to 256 in 4ae5f52
will fail for certain
psutilcases (yieldingZombieProcessandNoSuchProcessshown below for ease of viewing and linked)Added a try/except loop to catch the specific error and skip it.
This is the most intuitive way of catching this error as there is no way to filter the list of iterated processes to improve efficiency.
How to verify it
This is really tough - you need to somehow create a hanging process. It should be obvious from the code within
psutilhttps://github.com/giampaolo/psutil/blob/4446e3bd5fd29e0598f2ca6672d5ffe8ca40d442/psutil/_psosx.py#L336-L353
It will be difficult to create zombie processes or hanging processes for a full regression test. I don't think there should be test cases for such an obscure issue as a result. Satisfying the existing tests should be sufficient.
simple verification using existing bad system setup
as shown by ..
The fix avoids this problem ...
For now it can be manually corrected by removing the bad processes like
Checklist