Skip to content

[v7r1] Add listStatesForWeb endpoint to make Public State Manager faster#5159

Merged
atsareg merged 3 commits into
DIRACGrid:rel-v7r1from
chrisburr:faster-states
May 31, 2021
Merged

[v7r1] Add listStatesForWeb endpoint to make Public State Manager faster#5159
atsareg merged 3 commits into
DIRACGrid:rel-v7r1from
chrisburr:faster-states

Conversation

@chrisburr

@chrisburr chrisburr commented May 26, 2021

Copy link
Copy Markdown
Member

This PR fixes an issue in the web app which cases the Public State Manager to almost never load for some users due to the response being too slow. There are two main optimisations:

  1. Add a bulk endpoint to avoid the request scaling with latency * number of shared states
  2. Add a cache in UserProfileDB to avoid making the same few read/timestamp updates being made hundreds/thousands of times.

Note for 2. it uses cache tools which would need to be added in DIRACOS. Any objections?

I'll follow up with a WebApp PR which makes use of this.

BEGINRELEASENOTES

*Framework
NEW: Add UserProfileClient.listStatesForWeb endpoint to make the Public State Manager faster

ENDRELEASENOTES

Comment thread FrameworkSystem/DB/UserProfileDB.py
Comment thread FrameworkSystem/Client/UserProfileClient.py Outdated

types_listStatesForWeb = [dict]

def export_listStatesForWeb(self, permission):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of now there's no integration test for the UserProfileClient -> UserProfileHandler -> UserProfileDB (it should be in tests/Integration/Framework). I would say that this is a good occasion for adding it.

Comment thread requirements.txt
#asn1
M2Crypto>=0.36
autopep8==1.3.3
cachetools<4

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if this file is still used or not. If not, maybe we can remove it from v7r2?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use it in LHCbDIRAC’s CI for Python 2 and I’m not particularly eager to break that while it’s stable. I hope it can be left as is until v8.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right. Sure, let's leave it.

Co-authored-by: fstagni <federico.stagni@cern.ch>
@atsareg atsareg merged commit c453fa4 into DIRACGrid:rel-v7r1 May 31, 2021
@chrisburr chrisburr deleted the faster-states branch May 31, 2021 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants