Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have developed a job in Talend studio that runs a windows Batch file using tSystem component.
The batch file kicks off a R script. I can see this R process in Windows task manager once the batch is executed.
At times when I have to kill the job from Studio or even from TMC the R script kicked off by windows batch keeps running even though the parent job has been killed.
Is there a way to find the PID from within Talend Studio and kill the R process as part of a job flow. I have a timeout context variable, which if not set after 1 hour will be used in tjava to kill the job, however the problem is that even if the job is killed - the R script will keep running - unless I can obtain the PID of this within the job flow and execute a taskkill command as part of the job flow.
I can run the following command to kill the executable:
taskkill /IM Rscript.exe /F
However the problem with this approach is that there may be other jobs running in parallel that may also be executing scripts using Rscript.exe .
How can I cleanly identify the PID and then kill it as part of the flow.
Thanks
Hi,
You will have to list the processed ids based on your user name and from that process id, pick the id which is having R script in the name.
If you are looking for different options available to see the task list, please refer the below link.
https://jpsoft.com/help/tasklist.htm
Once the Windows script is created, you can call them from tSystem component like any other command. Before initiating the kill command, please double check the process ids by printing them in the test flows.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Hi,
Could you please try the details given in below link?
Personally I have not tried it but it seems to have up votes.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂