[GRDM-62502] WEKOへのメタデータ登録が「INTERNAL SERVER ERROR」で終わることがある問題を修正 - #779
Draft
yacchin1205 wants to merge 2 commits into
Draft
[GRDM-62502] WEKOへのメタデータ登録が「INTERNAL SERVER ERROR」で終わることがある問題を修正#779yacchin1205 wants to merge 2 commits into
yacchin1205 wants to merge 2 commits into
Conversation
yacchin1205
force-pushed
the
fix/migration-historical-models
branch
from
August 24, 2026 01:33
f9aa83e to
e7bff0a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
WEKO へのメタデータ登録操作の後、進捗を取得する
weko_get_publishing_fileが 500 を返し、画面にエラーダイアログが表示されて登録完了の表示に進みません。サーバ側はKeyError: 'progress'で失敗しています。進捗取得は
AsyncResult.infoを複数回参照していますが、infoは参照のたびに celery のバックエンドへ問い合わせるため、タスクが進行中の間は参照ごとに内容が変わります(celery は完了状態になるまで結果をキャッシュしません)。'progress' in aresult.infoで判定した後、aresult.info['progress']を取り出す前にタスクが完了へ遷移すると、infoの中身が進捗({'progress': ...})から結果({'result': ...})に変わり、キーが存在しなくなります。画面は進捗を毎秒ポーリングしており、登録が成功する瞬間にこの遷移を引くと失敗します。同じ実装が
_get_publishing_project_metadata_progress、および Metadata アドオンのget_task_result/metadata_get_importing_datasetにもあるため、あわせて修正します。Changes
AsyncResultのstateとinfoを1度だけ取得した値で判定するように変更(WEKO では重複していた解釈処理を_resolve_deposit_taskに集約)QA Notes
Documentation
None
Side Effects
None
Ticket
GRDM-62502