Killing child process, not just the shell

Killing child process, not just the shell
#241 - 07/11/03 11:30 AM
Edit post Edit Reply to this post Reply Reply to this post Quote
Hi,
I am working on a system for automatically testing student submissions on an introductory course about unix scripting. The program works by running a test script on a student submission, using Runtime.getRuntime().exec(). The Process object has a limited life span of 10 seconds (by default), and if it is still running after these 10 seconds, Process.destroy() is used to kill it.
A bug exists when one of the submissions being tested times out. When the destroy() method is used it leaves a child process running... since students can also run
some tests from the file submission client, the number of hanging processes soon adds up as they test and test again to get it right before submission. Eventually this results in too many processes and the server keels over.
Does anyone have any ideas on killing these hanging processes?

Not much help, but I think this is a known bug ...
http://developer.java.sun.com/developer/bugParade/bugs/4770092.html

Similar Messages

  • Error when running the OWB process flow from the shell script

    Hi,
    I am able to deploy the process flow succesfully but when I execute the process flow from the shell script,I am getting the following error.Previously it worked fine.
    I had to make some chnage in the IP address,so i had to deploy again.
    Connected.
    SQL> @/oracle/product/owb92028/owb/rtp/sql/oem_exec_template.sql OWB_RTR LOC_P_REL PROCESS P_W_SOURCE "," ","
    Elapsed: 00:00:00.00
    Elapsed: 00:00:00.01
    Stage 1: Decoding Parameters
    | location_name=LOC_P_REL
    | task_type=ProcessFlow
    | task_name=P_W_SOURCE
    Stage 2: Opening Task
    declare
    ERROR at line 1:
    ORA-01422: exact fetch returns more than requested number of rows
    ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 17
    ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 137
    ORA-06512: at "OWB_RTR.WB_RT_API_EXEC", line 164
    ORA-06512: at line 205
    Thanks in advance.
    Vinay

    Hi Kamal and kanakam kolla,
    This is just to let you know that,I solved my problem little differently by creating a new location and deployed the process flow.Now my process flow is working fine when i call from the shell script.What i see is that, it does not update properly when we update and redeploy the process flow.So far this is the work arround i could think off and i succesfully tested this.
    Thank you Kamal and kanakam kolla,for giving a thought towards my problem.
    Thanks
    Vinay

  • [Solved] Bash: killing child processes

    I decided to make a session manager that will kill all child processes before exiting, the only problem is that it doesn't kill them all.
    I tried using the same function, and using it in conjunction with
    yes >/dev/null & bash
    yes >/dev/null & bash
    yes >/dev/null & bash
    yes >/dev/null & bash
    running in a terminal, and it sent all of them the TERM signal.
    I'm out of ideas.
    Code is here.
    The relevant section is:
    # Kill child process of given parent
    # This uses PIDs not names
    # Also prints out a list of child pids that should be killed
    # FIXME: Clean this up a bit
    kill_child_processes()
    PARENT_ID=$1
    # Find child processes and put them in the form PID%seperator%COMMAND
    local CHILD_PROCESSES=$(ps o ppid,pid,command | \
    awk "{if (\$1 == $PARENT_ID) {print \$2,\"_\",\$3;}}" | \
    sed 's| _ |%seperator%|')
    # Do this for each child
    for child in $CHILD_PROCESSES; do
    # Extract the PID and COMMAND into separate variable from $child
    local child_pid=$(echo $child | sed 's|%seperator%.*||')
    local child_command=$(echo $child | sed 's|.*%seperator%||')
    # If the child command has child processes, recurse through it
    if [ "$(ps o ppid,pid,command | awk "{if (\$1 == $child_pid) {print \$2;}}")" != "" ]; then
    kill_child_processes $child_pid
    fi
    # If the command isn't part of a blacklist, send it the TERM signal
    if [ x$(for dont_kill_command in $DONT_TERM; do \
    [ x$dont_kill_command == x$child_command ] && echo "MATCH"; \
    done) == x"" ]; then
    kill $child_pid &
    # echo the PID so we can use it later
    echo $child_pid
    fi
    done
    Thanks.
    Last edited by some-guy94 (2010-01-13 22:48:39)

    gradgrind wrote:You might like to try pkill / pgrep with the -g option?
    Unfortunately that isn't what I'm looking for, I want this to work with multiple sessions(not that difficult), and also work with other apps on other tty's.
    Currently what it does is it runs ps o ppid,pid,command x which gives a nice table
    1234 5678 command1
    1234 5679 command2
    and if the ppid matches the session's pid, it's pid is saved, and (this part is looped) if it has child processes, then the function is run on the pid, afterward the pid is killed.
    It works when I separate the function from the rest of the script, but when it is in a session it fails to work properly.
    Last edited by some-guy94 (2010-01-05 23:11:57)

  • Hide a  type of file System wide not just the extension*

    Is it Possible & if So  Howto hide a type of file System wide not just the extension*
    Am trying to HIDE the Associated file for Photo Processing software in Finder, its a Specific file to the Program & holds the Raw data text Processed Info
    . Would mean I would need to change each File individually
    Is there a way/apple script?
    Knowledge or experience would be Appreciated
    Thanks

    I followed these instructions and they work, but I also get errors. Here are two files in the directire, and the contents of ~/.profile, I called the function killextension:
    I run the command to hide the PDF:
    Note the two errors. Thank you very much, BTW. No more Dropbox attributes files!  

  • How can i print all the tab pages not just the first page (tab)

    how can i print all the tab pages not just the first page (tab)

    You would need to do this programmatically. Here's one way:
    Attachments:
    Example_VI_BD6.png ‏3 KB

  • My Photoshop CS 5 has some strange actions when I copy a portion of a photo using the clone stamp  to transfer to another part of the image. It carries the entire layer (not just the stamps selection) across the screen and I cannot place it where I need t

    My Photoshop CS 5 has some strange actions when I copy a portion of a photo using the clone stamp  to transfer to another part of the image. It carries the entire layer (not just the stamps selection) across the screen and I cannot place it where I need to. It appears as if I selected the entire layer on purpose (which I did not)
    The below items appeared when I opened Photoshop CS 5:
    “Photoshop has encountered a problem with the display driver and has temporarily disabled G & U enhancements. Check the video card malfunctions website for latest software. GPU enhancements can be enabled in the performance panel of preferences.”
    (I believe this started after the automatically updated Windows was applied. It was coincident with the before mentioned problem . . . but I don’t really know if it had anything to do with it. )

    For the Clone Stamp problem, check the Clone Source panel and Clipped is probably unchecked.
    If so, check Clipped and see if that makes a difference.
    (Window>Clone Source)
    As to the video card problem:
    Which version of windows are you using?
    What is the make and model of your graphics card?
    Do you know which update windows installed?

  • Itunes no longer has my music in my music library. How do I transfer ALL my music (not just the purchased from Itunes) from my Ipod Touch back to my Itunes library on my computer.

    ITunes no longer has any of my music in my music library. How do I transfer all of my music ( not just the purchased music from ITunes) from my IPod Touch to Itunes library on my computer for syncing to other devices.

    Recovering your iTunes library from your iPod or iOS device: Apple Support Communities

  • HT1296 My I-Phone has music on it that was synced from an I-Tunes library from a previous computer (which is no longer in use) AND purchases from the I-Tunes store.  I would now like to transfer ALL of that music (not just the purchases from the I-Tunes s

    My I-Phone has music on it that was synced from an I-Tunes library from a previous computer (which is no longer in use) AND purchases from the I-Tunes store.  I would now like to transfer ALL of that music (not just the purchases from the I-Tunes store) into the I-Tunes library that I've established on a new computer.
    Can that be done, and how (I've attempted without any success)?
    Any assistance would be GREATLY appreciated!!

    Contact iTunes support and explain your situation to them.  They may let you redownload it at no cost.
    http://www.apple.com/support/itunes/contact.html
    If they don't, I'm afraid you'll have to purchase it again.  Sorry.
    B-rock

  • Is there any way to transfer an entire library from an ipod to a new laptop (not just the purchases)?

    My laptop was stolen that had my itunes installed and was synced with my ipod classic. I now have a new laptop. Is there any way I can transfer ALL the music from my ipod to itunes on the new laptop, not just the purchases? I don't have access to all the CD's etc that I originally downloaded onto my ipod.

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Help!  iTunes has completely disappeared off my iPhone 4s, yes the program, not just the app, and all my music has gone!  How can I get this back?  Thanks!!

    Help!  iTunes has completely disappeared off my iPhone 4s.  Yes the Program, not just the app!  All my music has just vanished!  How do I get this back!!
    (p.s. I do suspect a deletion has occurred courtesy of my 4 year old nephew, some other stuff has gone too, but beats me how he deleted a whole program!!!)

    Hi clorowan
    I found the following information that may be helpful:
    iTunes: Finding lost media and downloads
    http://support.apple.com/kb/TS1408
    Alternatively, if your media was downloaded from the iTunes Store, you may be able to download it again free of charge:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    http://support.apple.com/kb/HT2519
    Thanks,
    Matt M.

  • When I create a photo stream in ios6, everyone who is logged in to my iCloud account can see and edit my stream (on their iPhones only). Not just the email addressees that I sent the photo stream link to. Is that how photo stream security is meant to work

    When I create a photo stream in ios6, everyone who is logged in to my iCloud account can see and edit my stream (on their iPhones only). Not just the email addressees that I sent the photo stream link to. Is that how photo stream security is meant to work? Is so it means my whole family can see any photo stream I set up. Hence no security? Can't share the pics with the wife then :(

    The whole idea to an icloud account is that one user uses it and has all their devices synced together.  Different users need different Apple IDs to create their own icloud accounts.  Note that everyone can still use the same ID for an iTunes account (to share purchases).
    To create a new icloud account, go to
    http://www.apple.com/icloud/setup/

  • Profile Manager deleted all of my files - not just the profile. Any tips on what happened and how to resolve?

    I created a profile with Profile Manager. It dumped a lot of files into the directory that I selected. At that point I wanted to delete the profile and the associated files. When I selected the Delete Profile and Delete Files option it delete all files and folders in the directory - not just the profile files. It offered no warning that it was going to delete more than the profile files. Why did it do this and is there a way to recover the missing files? OS = Windows 7.

    You should never select a folder to be used as profile folder that already has files in it.<br />
    You should always choose a new and empty folder because you can use the Profile Manager to take up an existing profile by choosing the location.<br />
    Removing the profile and opting to delete the files will remove all the files in that folder and remove the folder as well, so be cautious with doing that.

  • Is it possible to sync all the email in a folder, not just the last few months worth?

    Is it possible to sync all the email in a folder, not just the last few months worth?

    Hi Mengelkemier,
    I think you're posting in the wrong forum.  This forum is intended to be used to discuss virtualizing Exchange Server on the the vSphere platform.  The question you're asking seems to be a mobile device specific question.
    You would probably get better visibility posting on a forum dedicated to your particular device.  And for what it's worth, some devices will let you sync all of your email and others will only let you sync a certain amount.  It's dependent on the device you're using.
    Good luck in finding your answer.
    Matt

  • CAN I ENLARGE THE SIZE OF ALL TRACKS AND NOT JUST THE ONE TRACK AT A TIME

    I would like to enlarge the tracks on the top half of the mix screen and not just the one track I'm working on. I find that most times I'm working in 2 or 3 tracks only and it would be great if I could enlarge the size of those to work with rather than the thin tracks they appear as. I realize if I click on one that it will appear larger below to edit but can I have all the tracks recorded appear larger?
    [email protected]
    Ross

    NO

  • Results slide showing all question pool results not just the ones completed.

    I have several question pools which have the option to be taken independently or separately.
    If the user does not take all seven of the modules then the quiz results slide at the end is incorrect as it will report all of the questions not just the ones attempted.
    I have tried the Branch aware option in the quiz results option but that did not worth.
    It this an easy fix or does it require me to add a variable count for each correct answer.
    Many thanks
    Rick

    Branch aware should be just fine for that case, why do you tell it is not working? Branch Aware Quiz - Captivate blog
    When you say 'score slide is not reporting correctly', I had no such problems.
    You could create a custom score slide indeed, using variables, but what if you have to report as a SCORM? Only possibility in that case is Branch aware.

Maybe you are looking for

  • Open VI reference and paths problem

    Hi, in my project I need to have a VI running independently from the calling VI so I use VI Server and "Open VI reference" to run the VI. However this is not without problems. The VI that I run is not in the same folder, as the caller VI and also not

  • Lightroom 4 camera raw plugin 7.4 install questions

    I have Lightroon 4 and CS4, When I right click to edit in CS4 I get a dialog box that says "This version of lightroom may require the Photoshop camera RAW plug-in version 7.4 for full compatibility. Any help?

  • Invoice and Credit note posting not matching

    Hi All, An invoice was issued with two items so the credit note in reference to that invoice (to reverse the invoice) has been issued item wise. The problem is that the amount of credit note and the invoice is not matching so the posting does not cle

  • Resize a LUN?

    I'm using Xsan with an Xserve RAID and I'm trying to get the resize LUN feature to work. As a test I had three 750 GB drives in a RAID 5 array. This was initialized in Xsan as a LUN and added to a storage pool. I then used RAID Admin to add two more

  • Problem using Cipher*Stream and Properties

    I ran into a tricky problem using CipherInputStream, CipherOutputStream and Properties. I don't seem to find where I'm doing something wrong here. I have something like this: encCipher; // and already initiated ENCRYPTION Cipher FileInputStream fis =