dmwm / WMCore

Core workflow management components for CMS.
Apache License 2.0
46 stars 107 forks source link

Fix how the Job.load() works for the mask information retrival #6438

Closed ticoann closed 6 years ago

ticoann commented 8 years ago

This cause Oracle unittests fail (Thanks to Valentin's investigation).

It seems when there is multiple masks associate the given job id, it relies on the order of the mask it is loaded (which seems to be different between Mariadb and Oracle.

Need to check what gets loaded in following line between MariaDB and Oracle. https://github.com/dmwm/WMCore/blob/master/src/python/WMCore/WMBS/Mask.py#L138

When following test ran,

https://github.com/dmwm/WMCore/blob/master/test/python/WMCore_t/WMBS_t/Job_t.py#L451

ticoann commented 8 years ago

@amaltaro, Alan, following line doesn't make much sense when we have multiple job mask in the same job. https://github.com/dmwm/WMCore/blob/master/src/python/WMCore/WMBS/Mask.py#L138 Are we not allow multiple mask in the same job? There is no prevention for that in the db code. If we allow that, I don't quite understand the logic in this loop. If you know what is going on, could you explain to me?

amaltaro commented 8 years ago

I agree L138 makes no sense for multiple mask. This also doesn't make sense to me: https://github.com/dmwm/WMCore/blob/master/src/python/WMCore/WMBS/Mask.py#L165 why would we save/add a runAndLumis only when the mask has the same firstRun and lastRun?

This is the output I get in oracle {'LastRun': 6, 'FirstRun': 5, 'inclusivemask': True, 'runAndLumis': {}, 'LastEvent': 2, 'FirstEvent': 1, 'LastLumi': 4, 'FirstLumi': 3}

I'm really not sure a job can have > 1 mask. Are you planning to change the code or only the test? If the former, then make sure it needs to be changed, otherwise let's not change what works now :)