HEPCloud / decisionengine_modules

Apache License 2.0
2 stars 19 forks source link

factory_global.py errors out returns a type None in some circumstances #410

Open StevenCTimm opened 2 years ago

StevenCTimm commented 2 years ago

In a strange corner case where the glideinwms factory is up but does not have any glidefactoryglobal classads in it, the factory_global data block returns a None data type instead of an empty data frame, causing the source to go offline. (The framework doesn't detect this correctly either, will add an issue on that side too)

An exception should be thrown in this case, as a blank data frame won't help anything, the transforms that depend on this data block won't be able to do anything without at least some factoryglobals. To be clear this should only be thrown if none of the factories in the list return any factoryglobals. As long as there is at least one factory global from one factory you can do something.

StevenCTimm commented 2 years ago

This is related to framework issues https://github.com/HEPCloud/decisionengine/issues/639 and https://github.com/HEPCloud/decisionengine/issues/638 both of which have already been filed, I don't have to do anything else on this.

To be clear when I say an exception should be thrown, it should be a different exception that is thrown in this corner case when the factory is up but doesn't have classads, than if it is down altogether and it can't even be contacted, or if there's some kind of an authentication error such that the factory is listening on the 9618 port but rejecting the command. the factory_entries source should be similarly outfitted with this kind of error checking.