Closed brianmcmichael closed 8 years ago
Clarification:
qdel
using shell always returns true.
qdel
using PBS returns true or throws exception.
I propose qdel
using PBS return true or false.
I think osc-machete always returning true on #qdel
was because Eric never tested for errors. I am fine with you catching the errors received from pbs-ruby
and returning false instead.
In vncsim
I just do...
begin
osc_session.job.delete
end
So I ignore any errors raised by PBS
and move on.
Solution merged into release/1.0
Currently, the
qdel
command returns true or throws an exception. https://github.com/AweSim-OSC/osc-machete/blob/master/lib/osc/machete/torque_helper.rb#L106PBS raises exception here. https://github.com/AweSim-OSC/pbs-ruby/blob/c1586a2e7815d8ca6ab3e98bd3a1016ccc1dcfc5/lib%2Fpbs%2Ftorque.rb#L60
I've kept with the
return true
convention, but realized that it's entirely possible that a user will try to qdel a job that's already completed and an exception will be raised.I can handle this exception to prevent the app from breaking, but the question is, should I continue returning 'true', or modify the qdel to return
false
on fail? I lean toward the latter, but I'm not sure if that would cause unexpected behavior in existing apps.