microsoft / onefuzz

A self-hosted Fuzzing-As-A-Service platform
MIT License
2.82k stars 199 forks source link

A CPU-bound tokio task can block oom-checking #3379

Open tevoinea opened 1 year ago

tevoinea commented 1 year ago

Information

Provide detailed reproduction steps (if any)

select! runs tasks concurrently but not in parallel. Since tokio does not preempt tasks, a CPU bound task that doesn't call .await can block us from checking oom conditions for a period of time longer than what we have defined in OOM_CHECK_INTERVAL.

https://docs.rs/tokio/latest/tokio/macro.select.html#runtime-characteristics

Expected result

What is the expected result of the above steps?

We should spawn a new thread for our oom-check and/or for the actual OneFuzz task execution future.

AB#163025