bipinprasad opened a new pull request #3273:
URL: https://github.com/apache/storm/pull/3273


   What is the purpose of the change
   When checking if all processes are dead, each process is checked by issuing 
a "ps" or "tasklist" command. This command uses LDAP integration in Linux to 
determine user. When LDAP is slow, this
   process overall response time is slow.
   
   (Explain why we should have this change)
   This change checks all processes in a single command, and thus avoid 
expensive subprocess invocations. For POSIX systems, and additional speedup is 
achieved using cached mapping of USER to UID mapping and using uid to determine 
liveness. The latter avoid LDAP hits altogether and avoid LDAP timeouts.
   
   How was the change tested
   A new test ContainerTest.testIsAnyProcessAlive() was written to test both 
the positive and negative cases. Additional test testGetUserId() checks 
correctness of getUserId. One more test ContainerTest.testIsProcessAlive() also 
tests prior functions which have been modified and did not have any tests. This 
uncovered problems in those methods when executing on Mac.
   
   (Explain what tests did you do to verify the code change)
   (1) Randomly generate a 12 character user which should not own any process. 
The method isAnyProcessProcessAlive() should return false when supplied the 
list of running PIDs.
   (2) Call isAnyProcessAlive() with all the currently running PIDs and supply 
the current user. Since the current user owns one process (the test itself), 
this should return true.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to