cirruslabs / orchard

Orchestrator for running Tart Virtual Machines on a cluster of Apple Silicon devices
Other
189 stars 13 forks source link

Asynchronous VM creation #163

Closed edigaryev closed 3 months ago

edigaryev commented 3 months ago

Resolves https://github.com/cirruslabs/orchard/issues/161.

fkorotkov commented 3 months ago

Should we just put worker.updateWorker on a separate goroutine?

https://github.com/cirruslabs/orchard/blob/a5c653d0a6f42b37c5c4624b10f8e272849863a7/internal/worker/worker.go#L124-L128

This change doesn't seem make syncVMs async which seems to be a cause of #161.

edigaryev commented 3 months ago

Should we just put worker.updateWorker on a separate goroutine?

Technically we could, but this kinda goes against the idea of having a lightweight main loop and long-running async operations that we poll from that loop.

Note that this change also prevents the blocking of service for other VMs in syncVMs(), but if we were to only make the updateWorker() async, that would not be solved.

This change doesn't seem make syncVMs async which seems to be a cause of #161.

Could you elaborate on why?