This is to discuss with other PBSPro devs on how we should go about solving race conditions which occur because of the way the scheduler currently queries PBS data from the server. Currently, the scheduler makes multiple queries to the server to finally piece together all of the information that it needs from it, which means that the scheduler can potentially have inconsistent information if the data changes in between the different queries.
So, I wanted to discuss a solution to this. The fundamental issue is multiple queries, so it definitely needs to be a single query.
A couple of possible solutions which came out of a short discussion with Bhroam, Bill and Subhasis:
- Store things to a database which can be queried for all of the data that the scheduler needs in a single query, with transaction atomicity. Would be great if one of the standard DBMS softwares can do the job, or we'd have to come up with our own data service to cater to any specific PBSPro needs. Possible drawback: this might require quite a bit of refactoring and take considerable effort and time.
- Create a new IFL call which can return all PBS data. Possible drawback: might make things tricky if we multi-thread the server in future.
What do you guys think? Any other ideas? Any comments on the two solutions mentioned above?