Setting a curation label via API takes long time
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 564
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 29
Description
What steps does it take to reproduce the issue?
add a curation status label to a dataset (or delete one) via API call, when a valid set of curation labels is configured.
PUT api/datasets/{$DATASET-ID}/curationStatus?label={$MYLABEL}
DELETE api/datasets/{$DATASET-ID}/curationStatus
- When does this issue occur?
It's only taking long time, if an existing curation label is deleted or a new curation label is set.
Getting the curation label or trying to set an already existing curation label is fast.
We identified the line of code, where the delay happens:
line 2159 in DatasetVersion.java (function addCurationStatus -> curationStatuses.add())
It seems to have something to do with the operation on the list of curationStatus objects and perhaps with the sorting.
-
Which page(s) does it occurs on?
Via API -
What happens?
The API call takes several seconds and runs sometimes into an internal server error. -
To whom does it occur (all users, curators, superusers)?
all API-users -
What did you expect to happen?
no internal server error, faster API call.
Which version of Dataverse are you using?
6.10.1
Any related open or closed issues to this bug report?
have not found any
Are you thinking about creating a pull request for this issue?
Help is always welcome, is this bug something you or your organization plan to fix?
If we find a way...
Identified together with @ffritze
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with DatasetVersion.java at line 2159 in addCurationStatus, then reproduce the PUT and DELETE curation-status API calls described in the issue. Inspect the curationStatuses.add() operation and any sorting involved. Done means changing or deleting a curation label completes faster and does not produce an internal server error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100