Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Best Way to kill Pentaho Job if it runs over 3 hours or (insert time)?

  1. #1
    Join Date
    Sep 2014
    Posts
    175

    Default Best Way to kill Pentaho Job if it runs over 3 hours or (insert time)?

    Hey there --

    Recent events have shown me there may be use for killing a 'rogue' job that for some reason is taking an hour+ (most of my jobs take anywhere from seconds to maybe 6-7 minutes tops).

    IE -- recently I noticed the remote server running my job was having hardware issues. Temporarily, I will probably have a backup machine run the incremental jobs as well.


    However I need a way to kill a hour+ job if such an event happens again.


    Simplest way I can think of right now is to say ... if I start all the jobs at midnight typically ... just have a .bat file with /kill javaw.exe start at 1 or 2 am.

    This would suffice but I wonder if there is a more sensible way, like a command line message to simply stop the job.

  2. #2
    Join Date
    May 2016
    Posts
    282

    Default

    Not as simple as killing all java processes still running, but I would look into creating an audit database for your jobs and transformations and building queries to control how your processes are running. I haven't explored yet the audit database in Pentaho, but I've used it in other tools previously so I'm already logging everything I run into it and I'll see how to take advantage of it in the future.
    Logging everything into the database is easy and straightforward, each job and transformation has in their properties a Logging Tab where you setup your Audit Database information, with the SQL button you get the scripts to create your tables, and if you use a template for creating your jobs and transformations with the Logging tab setup, you just need to do it once (although you'll have to do it for all your previously created jobs and transformations )

  3. #3
    Join Date
    Aug 2016
    Posts
    11

    Default

    how about

    1- start job

    2- start .bat in background using "shell script" step: this would be "sh timeout.sh &" in bash, not sure what the windows equivalent is to make it run asynchronously. All this script needs to do is wait for T minutes and then kill java.

    3- run your old job inside this one (this can be parametrized so you don't need to make a different timeout job for every one you've already built)

    4- after the job is done, run another .bat script to kill the first one

    I'm not familiar with windows shell scripting but it should be fairly simple to write
    Last edited by pedrogfp; 12-22-2016 at 09:19 AM.

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Terminating a long running Kettle job under Windows?
    Doesn't the Windows Task Planner option for this work like expected?
    So long, and thanks for all the fish.

  5. #5
    Join Date
    Oct 2016
    Posts
    3

    Default

    I have the same issue: to kill 'java.exe' if it runs more then 2 hours. But in my case there are more than one copy of java runs at the same time on windows-machine.

    I wonder if it possible to add into
    Spoon.bat some code that can capture into a txt-file PID of just started java.exe and then kill process by the PID, because Task Scheduler do not manage with killing frozen java.exe.
    Last edited by GTDunk; 12-27-2016 at 09:15 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.