-
Notifications
You must be signed in to change notification settings - Fork 441
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
Create Collection takes 30-45 seconds & sometimes times out #2914
Comments
Hi @tdonohue, reading the description of the issue, I think it could be related to a consumer configured to reload the submission configurations when a collection is edited/created. See: https://github.com/DSpace/DSpace/blob/main/dspace/config/dspace.cfg#L833-L835 I think that this consumer could be refactored to avoid reload the configurations multiple times during the creation of a collection, moving the reload process to the I am not able to reproduce it locally, but I suppose that it happens because in demo and sandbox reloading the submission configurations takes more time. I will send a PR with the proposed changes to see if it could solve or mitigate the issue. |
@toniprieto : That would be wonderful! I had actually just realized myself that the likely cause is the |
NOTE: After applying the fix in #9462, the "Create Collection" step is much faster... though it's still slightly slower than I'd like to see. It now takes ~6 seconds instead of ~30-45 seconds. We may need to consider ways to speed this up further...or possibly run the submission config "reload" behind the scenes (instead of waiting on it to complete before returning). But, for now, the significant performance issue is fixed. |
There is an issue DSpace/DSpace#9402 that is addressed with: DSpace/DSpace#9415 . This PR fixes an issue that limit you to a maximum of 10 collections per entity type (default solr rows limit). But that one isn't in DS source yet. By choosing Solr as a solution for enabling you to set a form based on the defined entity types at collections, Also, does the repository changes the configuration?
Currently, with our local migrated repositories we didn't verified this issue. With our local repositories it takes about 15 sec to create a new collection and 5 sec to effectively edit it. Perhaps the issue could also be with policy creation. |
A better implementation to the one I did with forms loading, with some associated effort, would be to also consider an alternative way how submission forms are made available. Currently, it's based on the configured collections, specifically on the collection's Handle, but, perhaps it makes sense to do a runtime validation based on the entity type for the provided collection. |
@paulo-graca : I can verify the behavior here was on sandbox.dspace.org and demo.dspace.org. Those sites both use default settings in I've not yet narrowed down why this I'll take a closer look at DSpace/DSpace#9415 as well to see if there are improvements there...but at a glance, I'm not sure whether that will impact performance. It does seem like an important bug fix though which we should get into 8.0 and 7.x |
@paulo-graca I think it's a good idea to implement what you suggested in your last comment. In version 8.x, a change that allows configuring forms at the community level has been included (DSpace/DSpace#9259). With this change, the function that returns the Item Submission process used by a collection receives a collection as a parameter (previously it received a handle). See: Having the collection makes it simpler to retrieve the entity type and read a map with the relation between entityTypes and item submission process that could be built during the initial load. This way, there would be no need to perform a submission config reload when a collection is edited/created and the issue DSpace/DSpace#9402 should also be resolved. |
@paulo-graca @tdonohue I've had time these days to implement the approach described in the last comment, and I've sent a PR: DSpace/DSpace#9478 The implementation is very similar to DSpace/DSpace#9259 |
Describe the bug
This issue is reproducible on both https://sandbox.dspace.org (running pre-8.0) and https://demo.dspace.org (running 7.x). When attempting to create a new Collection, the request always takes a long time (at least 30-45 seconds) and sometimes times out with a 504 Gateway Timeout error.
This issue only occurs for creation of Collections. Creating Communities or Items seems uneffected.
To Reproduce
Steps to reproduce the behavior:
POST
request was made to/server/api/core/collections?parent=[community-uuid]
. It will remain "Pending" for the entire 30-45 seconds.dspace.log
file, thePOST
request appears to succeed almost immediately. It's unclear why it stays "Pending" for so long, and whether the bug is in the frontend or backend.Expected behavior
Creating a Collection obviously should be as fast as creating a Community.
Related work
It's unclear what caused this bug, but the bug exists in both
dspace-7_x
andmain
. So, that implies it was caused by a bug fix which was applied to both branches.The text was updated successfully, but these errors were encountered: