Skip to content

[ENG-10365] Make waterbutled callback after addons archiving is finished#11787

Open
ihorsokhanexoft wants to merge 2 commits into
CenterForOpenScience:feature/pbs-26-13from
ihorsokhanexoft:fix/ENG-10365
Open

[ENG-10365] Make waterbutled callback after addons archiving is finished#11787
ihorsokhanexoft wants to merge 2 commits into
CenterForOpenScience:feature/pbs-26-13from
ihorsokhanexoft:fix/ENG-10365

Conversation

@ihorsokhanexoft

Copy link
Copy Markdown
Contributor

Ticket

https://openscience.atlassian.net/browse/ENG-10365

Changes

Implement solution from analysis ticket. Here is the issue description and proposed solution:
https://openscience.atlassian.net/browse/ENG-10851?focusedCommentId=121306

Call archive_callback only after all addons are archived

@sh-andriy sh-andriy left a comment

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.

archive_callback.si(dst=dst) passes the model instance as a task arg. It survives today because enqueue_task runs this eagerly in the worker (no app context), but it's not broker-safe — default serializer is json, so anything that routes this through apply_async throws EncodeError on the Registration. Rest of the module passes ids for that reason (dst_pk=root._id, job_pk=...). Can we do dst_pk=dst._id and Registration.load(dst_pk) inside the task, matching archive_success?

Also worth a sanity check on timing: archive_addon just fires make_copy_request.delay() and returns, and the target only flips to SUCCESS when WB calls back into the update view. So the chained callback lands while archive_tree_finished() is still False and bails — same as before. Does this actually change the completion path for the stuck-archive case, or just reorder the early no-op?

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.

2 participants