samza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jagadish Venkatraman <jagadish1...@gmail.com>
Subject Re: Review Request 46546: SAMZA-940 TestProcessJob.testProcessJobKillShouldWork fails occasionally
Date Fri, 22 Apr 2016 01:09:50 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/46546/#review130002
-----------------------------------------------------------



Thanks for the patch! Overall, it looks good. I mostly have some questions/nits.


samza-core/src/main/java/org/apache/samza/job/util/ProcessKiller.java (line 27)
<https://reviews.apache.org/r/46546/#comment193605>

    nit:
    What's the purpose of this class? 
    
    1.If this is a utility class (this is what I think it is), How about naming it as ProcessUtil
or even a more general Utils class with a killForcibly (process) method.
    
    We can explicitly provide a private constructor in that case to ensure that we prevent
instantiation of ProcessUtil.
    
    2. If this is not a utility class, then, maybe an instance of a ProcessKiller can be instantiated
with a Process object in its constructor. (It can then expose a kill method that will kill
its process)?



samza-core/src/main/java/org/apache/samza/job/util/ProcessKiller.java (line 31)
<https://reviews.apache.org/r/46546/#comment193613>

    nit: It was my understanding that destroy() was implementation dependent (and continues
to be) in java (7 and 8). 
    
    destroyForcibly() terminates a process with a much higher degree of success.



samza-core/src/main/java/org/apache/samza/job/util/ProcessKiller.java (line 33)
<https://reviews.apache.org/r/46546/#comment193617>

    nit: I'm not sure the existing contract of destroy was changed. (AFAIK, they added a new
method in java 8).. Maybe, I'm missing something. Could you please provide me to a link?


- Jagadish Venkatraman


On April 22, 2016, 12:08 a.m., Jake Maes wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46546/
> -----------------------------------------------------------
> 
> (Updated April 22, 2016, 12:08 a.m.)
> 
> 
> Review request for samza, Navina Ramesh, Jagadish Venkatraman, Xinyu Liu, and Yi Pan
(Data Infrastructure).
> 
> 
> Bugs: SAMZA-940
>     https://issues.apache.org/jira/browse/SAMZA-940
> 
> 
> Repository: samza
> 
> 
> Description
> -------
> 
> SAMZA-940 TestProcessJob.testProcessJobKillShouldWork fails occasionally
> 
> It looks like this has been a problem since Java 8. Java 8 changed the meaning of Process.destroy().
It used to forcibly destroy the process, but now it is a "normal termination" and destroyForcibly()
is the method that force-kills the process. 
> 
> Since destroyForcibly() was only introduced in Java 8, the best solution I found was
to use reflection to call that method if it exists. 
> 
> References:
> https://docs.oracle.com/javase/7/docs/api/java/lang/Process.html#destroy()
> https://docs.oracle.com/javase/8/docs/api/java/lang/Process.html#destroy--
> 
> Java 9 docs are a bit clearer
> http://download.java.net/jdk9/docs/api/java/lang/Process.html#destroy--
> 
> 
> Diffs
> -----
> 
>   samza-core/src/main/java/org/apache/samza/job/util/ProcessKiller.java PRE-CREATION

>   samza-core/src/main/scala/org/apache/samza/job/local/ProcessJob.scala 66618165d27aa916238cc86b27631c5db3435c6a

> 
> Diff: https://reviews.apache.org/r/46546/diff/
> 
> 
> Testing
> -------
> 
> Ran the test a number of times and haven't seen the assertion fail.
> 
> 
> Thanks,
> 
> Jake Maes
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message