autolab / Tango

Standalone RESTful autograding service
http://www.autolabproject.com/
Apache License 2.0
48 stars 59 forks source link

Added None check before logging statement in JobManager #195

Closed mojojojo99 closed 3 years ago

mojojojo99 commented 3 years ago

Addresses some underlying issues that were hinted at in #182:

Changes proposed in this PR:

Beware, before merging, please do make sure that the below changes are what you intend:

Is this the desired behavior of the autograder when there are not enough VMs? Perhaps you might also want to consider simply blocking the job when there are no available VMs to use, and waiting for another vm to be freed instead of always creating new VMs. This will potentially cause a lot more VMs to be created during peak usage.

To show this problem, I wrote a short test in #191, which might be good as a reference.

fanpu commented 3 years ago

Thanks for your PR yet again!

Yes, I agree that the exception gets thrown if preVM is None in jobManger.py which is possible. However, this case is actually subsequently handled within worker.py as you noted.