IQSS / IQSS/dataverse

Add status check and/or locks for APIs that are executed asynchronously (index, export)

Open
#8,333 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

As submitted by a user:

reExportAll ... returns a message:

curl http://localhost:8080/api/admin/metadata/reExportAll
 {"status":"WORKFLOW_IN_PROGRESS"}

If I remember correctly the reindexing also returns a similar status message. If I see something like that I expect that I can recheck the status until I get a different status message informing that it is done. However when I search for reExportAll in the manual I haven't found a call where I can retrieve the current status. Is there such an API call?

Currently, the answer is no. There is no way to check on the status of either call via API (although the progress of indexAll can be checked by looking at the server log). It is also possible to start another indexAll or exportAll job when one is already running.

A possible solution would be to change this behavior under the model already used in the publish dataset API, that is also executed asynchronously: we return the same code 202/"WORKFLOW_IN_PROGRESS", but lock the dataset for the duration of the execution. The lock prevents another attempt to publish the dataset from being started. And makes it easy to check if the task has been completed.

All our currently implemented locks are dataset locks. But this may be worth introducing a new class of application locks, perhaps?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the reExportAll, indexAll, and exportAll API behavior described in the issue, then compare it with the asynchronous publish dataset API and its existing dataset-lock model. Check the manual and server-log status information currently available. Done should include a defined way to check completion and behavior that prevents overlapping jobs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.