Skip to content

Comments

Move workflows to onSuccess, use async export when publishing#12099

Open
qqmyers wants to merge 8 commits intoIQSS:developfrom
QualitativeDataRepository:Arch1-createWFLocksEarly
Open

Move workflows to onSuccess, use async export when publishing#12099
qqmyers wants to merge 8 commits intoIQSS:developfrom
QualitativeDataRepository:Arch1-createWFLocksEarly

Conversation

@qqmyers
Copy link
Member

@qqmyers qqmyers commented Jan 21, 2026

What this PR does / why we need it: This PR moves running workflows into the onSuccess method (an old ToDo) and changes the code to add workflow locks before the current transaction ends in the publish/finalize commands and the dataset :releasemigrated API call. Earlier code relied on a 1 second pause when the asynchronous workflow starts to allow to initiating transaction to end before the workflow created it's own lock. This left a ~1 second gap when the dataset was not locked ( and added a second to execution). The change in this PR creates the lock in the initiating transaction and passes that to the workflow. (If a lock is not set the code defaults to the old behavior.)

The PR also changes exporting in the finalize publish command to be asynchronous and adds checking/recovery if an OptimisticLockException occurs (possible, for example, if a workflow completes and, like archiving, updates the datasetversion before export can run.)

Which issue(s) this PR closes:

  • Closes #

Special notes for your reviewer:

FWIW: This is one of several PRs related to updates being done to improve archiving scalability at QDR and DANS. Some are relatively minor cleanup while others are more significant. I'm submitting them all to avoid drift in QDR's fork and to leverage QDR testing (where all of these are being tested together).

Suggestions on how to test this: Regression - index, export, and any configured workflows should complete as before. For a long-running workflow (such as archiving on a dataset with many files), the workflow lock should be in place (visible in UI, via API, in db). Nominally one could verify that there no longer is a gap between the finalize lock being dropped and the workflow lock being created, but not sure it's worth it.

It may be worthwhile to engage DANS, which is leveraging workflows, to confirm that these changes don't break their setup as well.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?: Will create an aggregate one

Additional documentation:

@qqmyers qqmyers changed the title Arch1 create wf locks early Move workflows to onSuccess, use async export when publishing Jan 21, 2026
@coveralls
Copy link

coveralls commented Jan 21, 2026

Coverage Status

coverage: 24.327% (-0.007%) from 24.334%
when pulling 609e2b5 on QualitativeDataRepository:Arch1-createWFLocksEarly
into cc37d4d on IQSS:develop.

@qqmyers qqmyers marked this pull request as ready for review January 28, 2026 20:28
@qqmyers qqmyers added GDCC: QDR of interest to QDR Size: 10 A percentage of a sprint. 7 hours. labels Jan 28, 2026
@qqmyers qqmyers added this to the 6.10 milestone Feb 4, 2026
@cmbz cmbz moved this to Ready for Review ⏩ in IQSS Dataverse Project Feb 11, 2026
@cmbz cmbz added the FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) label Feb 11, 2026
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

Seems reasonable. Approved.

@github-project-automation github-project-automation bot moved this from Ready for Review ⏩ to Ready for QA ⏩ in IQSS Dataverse Project Feb 17, 2026
@stevenwinship stevenwinship self-assigned this Feb 19, 2026
@stevenwinship stevenwinship moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Feb 19, 2026
@stevenwinship stevenwinship moved this from QA ✅ to Ready for QA ⏩ in IQSS Dataverse Project Feb 19, 2026
@stevenwinship stevenwinship removed their assignment Feb 19, 2026
@qqmyers qqmyers added the Status: Waiting for Related Issues/PRs This issue depends upon the completion of one or more issues/PRs label Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 17 FY26 Sprint 17 (2026-02-11 - 2026-02-25) GDCC: QDR of interest to QDR Size: 10 A percentage of a sprint. 7 hours. Status: Waiting for Related Issues/PRs This issue depends upon the completion of one or more issues/PRs

Projects

Status: Ready for QA ⏩

Development

Successfully merging this pull request may close these issues.

5 participants