TheRoddyWMS / BatchEuphoria

A library to access different kinds of cluster backends
MIT License
3 stars 5 forks source link

Rework waitForJobs so that new jobs are not allowed when the method was called. #131

Open dankwart-de opened 5 years ago

dankwart-de commented 5 years ago

This assumes that after activeJobs is empty, no new job will ever get added. This is true, if the client code works synchronously and really waits but does not call addToListOfStartedJobs(). Maybe this should be documented, that addToListOfStartedJobs()/submitJobs() should not be called while waitForJobstoFinIsh() is waiting.

A thread-safe (and thus preferable) alternative would be to block job submission while waiting for jobs.

Originally posted by @vinjana in https://github.com/TheRoddyWMS/BatchEuphoria/pull/129