alchemiscale icon indicating copy to clipboard operation
alchemiscale copied to clipboard

Add periodic checks by compute services that their claimed `Task`s are actioned by at least one active `AlchemicalNetwork`; halt execution and drop claim for those `Task`s that are not

Open dotsdl opened this issue 1 year ago • 1 comments

Currently, compute services like our SynchronousComputeService will continue executing a claimed Task even if that Task is no longer wanted by any user, and no longer actioned on any active AlchemicalNetworks. It will continue until execution has either succeeded or failed, and is largely a waste of compute resources that can come with additional opportunity cost if many such Tasks saturate limited resources.

Instead of this, we would like compute services to periodically check that their currently-claimed Tasks are still actioned by at least one active AlchemicalNetwork. For those Tasks that are not, they should immediately drop their claim and attempt to halt their execution.

To do this in the SynchronousComputeService, it will likely be necessary to make ProtocolUnit execution happen in a subprocess, since otherwise it will not be possible for ProtocolUnits executed in-process to be cleanly halted if the conditions above are met. The subprocess can then be SIGTERMed or SIGKILLed by the calling process.

dotsdl avatar Sep 11 '24 04:09 dotsdl

Originally raised by @JenkeScheen here: https://github.com/asapdiscovery/asapdiscovery/issues/1196

dotsdl avatar Sep 11 '24 04:09 dotsdl