Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Massive Warning spikes in Proposal Backend #914

Closed
TCMeldrum opened this issue Aug 24, 2023 · 8 comments · Fixed by UserOfficeProject/user-office-core#469
Closed

Massive Warning spikes in Proposal Backend #914

TCMeldrum opened this issue Aug 24, 2023 · 8 comments · Fixed by UserOfficeProject/user-office-core#469
Assignees
Labels
area: uop/stfc An issue relating to the STFC user office project. status: in-progress The issue has work that is now in progress.

Comments

@TCMeldrum
Copy link

We have been seeing massive warning spikes in our logs every couple of days:
image

The issue seems to be when an Instrument Sci or UO is getting all the proposals it is calling the getUser endpoint on the UOWS for every principal investigator and if the UOWS isn't available at that moment it causes all these warnings. We should try and batch these requests to the UOWS through a batch loader.

@TCMeldrum TCMeldrum added area: uop/stfc An issue relating to the STFC user office project. status: new The issue is new and is waiting to be checked. labels Aug 24, 2023
@isisbusapps-ci
Copy link

There are a few batch methods on UOWS we could look at - Scheduler does something similar GetBasicPeopleDetailsFromUserNumbers might be a good start.

@Bhaswati1148
Copy link

  • The spike in the log was presumably due to the issues with loading too many proposals which is already tackled against Proposals fail to load as an experiment scientist #872
  • The fix was released in Release 2023-08-24 and no spikes have been observed in the logs since then
  • Keeping this issue open for a few more days just to confirm the errors don't re-appear, otherwise I hope it can be closed as fixed

@mutambaraf
Copy link
Contributor

We have limited the amount of proposals to 200 at a time because users was not able to keep up loading 15k proposals. The best solution should be to do a batch request to users if possible as suggested.

@Bhaswati1148
Copy link

Thanks for your comments , I was not sure if we need to do any further changes. I will look into this.

@Bhaswati1148
Copy link

As per my analysis so far, User-office-backend is making N+1 round trips to database/UOWS when fetching principal investigator details, while resloving the Proposal query.

Best approach to solve this would be using graphql/dataloader for batching requests to UOWS.

However, type-graphql integration with graphql/dataloader is not yet live (please see: MichalLytek/type-graphql#51), so we can't use it at this moment.

There is another option type-graphql-dataloader, which I believe we can use? I have done a small poc with this lib and it does the batching, but it has a dependency on apollo-server-express. At this moment I am trying to figure out how it can be used in our set up.

If there are any other potential options which we can consider, I'm open to them.

@Bhaswati1148 Bhaswati1148 added status: in-progress The issue has work that is now in progress. and removed status: new The issue is new and is waiting to be checked. labels Sep 14, 2023
@Bhaswati1148
Copy link

I have tried using type-graphql-dataloader in our project set up, but it is not compatible with apollo server 4.9.3, that we are currently using. Might have to look for other options

@srconway
Copy link

@Bhaswati1148 In case it's useful at all I've sent you a joining link for apollostudio

@Bhaswati1148
Copy link

@Bhaswati1148 In case it's useful at all I've sent you a joining link for apollostudio

Thank you @srconway , I shall have a look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: uop/stfc An issue relating to the STFC user office project. status: in-progress The issue has work that is now in progress.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants