I have developed a Python3 program/script that is fairly big. It depends on several external apps, including some apps I don't have a full control on. Just for example, I am using Selenium WebDriver and it happens that for some reason, it crashes and make my script wait undefinitely (try/catch Python structures don't even help in my case).
As my script is going to be launched many times and I don't want to pollute my host server with zombie procceses, I was thinking about virtualization to launch some kind of lightweight virtual machines to execute instances of this script (and its dependencies - Python libs and external programs), get the results, and shutdown it when finished.
In case of something goes wrong (let's say, no response for 20 minutes), I would then be able to shutdown this instance and keep my server clean.
From the researches I made on Google, it appears that OpenVZ or libvirt both could fit this need but I would appreciate any feedbacks or ideas.
I hope I'm clear enough as English is not my mother tongue. Please do not hesite to ask me to rephrase if needed.
Thank you !