Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start jobs in their own processes #21

Open
mimir-d opened this issue Oct 28, 2021 · 2 comments
Open

Start jobs in their own processes #21

mimir-d opened this issue Oct 28, 2021 · 2 comments

Comments

@mimir-d
Copy link
Member

mimir-d commented Oct 28, 2021

Issue by rjoleary
Saturday Mar 07, 2020 at 02:41 GMT
Originally opened as https://github.com/facebookincubator/contest/issues/71


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

  • Failure isolation: If a test panics unexpectedly (for example it runs out of memory), only that test is affected and not the whole system.
  • Cancel jobs: Allow jobs to be force cancelled simply by killing the process.
  • Resource limits: Each job can have its own limits on memory, fds, cpu, etc...
@mimir-d
Copy link
Member Author

mimir-d commented Oct 28, 2021

Comment by insomniacslk
Tuesday Mar 10, 2020 at 12:48 GMT


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

@mimir-d
Copy link
Member Author

mimir-d commented Oct 28, 2021

Comment by xaionaro
Tuesday Mar 10, 2020 at 13:24 GMT


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant