facebookarchive / contest

Run continuous and on-demand system testing for real and virtual hardware
MIT License
32 stars 15 forks source link

Start jobs in their own processes #71

Open rjoleary opened 4 years ago

rjoleary commented 4 years ago

Each jobs has its own process. This has the following benefits:

insomniacslk commented 4 years ago

Thanks @rjoleary ! This is something @marcoguerri and I have considered in the past, for the reasons you have mentioned above. The current design is also at risk of goroutine leak, and using processes for jobs will alleviate that too. I am wondering if we should have both, or just go with processes for everything

xaionaro commented 4 years ago

I am wondering if we should have both, or just go with processes for everything

Just to be on the same page: The kind-of-only way to have a process for each job in Go is to use os/exec (Go does not allow just to fork()/clone()). So it would require to essentially redesign some things within ConTest. So it will cost much more to support both "job-as-goroutine" and "job-as-process" (they will have different kinds of "manager->worker" communications).

Therefore it seems to me that if we want to do job-as-process then we need to drop support of job-as-goroutine. And if we afraid of complicating ConTest for simple users with simple cases, then we may make it as transparent as possible: to implement both functions (job management and job execution) within one binary which just calls itself (via os/exec) for job execution.