Skip to content

Clear multipart pending flag without resource_patch#13

Merged
jguo144 merged 2 commits into
masterfrom
jguo144/2026-04-30/update-clear-flag
May 1, 2026
Merged

Clear multipart pending flag without resource_patch#13
jguo144 merged 2 commits into
masterfrom
jguo144/2026-04-30/update-clear-flag

Conversation

@jguo144
Copy link
Copy Markdown
Collaborator

@jguo144 jguo144 commented May 1, 2026

Description

When finishing or aborting a multipart upload, clearing cloudstorage_multipart_pending no longer goes through resource_patch (and thus avoids the full package update / Solr indexing path). The flag is removed from resource extras with a direct SQLAlchemy update, flag_modified, and Session.commit().

Context

Multipart finish/abort only needs to drop an extra on the resource. Using resource_patch pulls in heavier CKAN action machinery than necessary, sometimes causing timeouts.

Changes

  • Add _clear_cloudstorage_multipart_pending(resource_id) in multipart.py.
  • Call it from finish_multipart and abort_multipart instead of resource_patch.
  • Capture resource_id / upload_name before deleting the multipart upload row so logging and storage calls stay safe.

@jguo144 jguo144 enabled auto-merge (squash) May 1, 2026 18:02
@jguo144 jguo144 requested a review from nolanpruett May 1, 2026 18:02
Copy link
Copy Markdown

@orca-security-us orca-security-us Bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Comment thread ckanext/cloudstorage/logic/action/multipart.py Outdated
@jguo144 jguo144 requested a review from nolanpruett May 1, 2026 19:33
Copy link
Copy Markdown

@nolanpruett nolanpruett left a comment

Choose a reason for hiding this comment

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

LGTM!

@jguo144 jguo144 merged commit cfe6c89 into master May 1, 2026
11 checks passed
@jguo144 jguo144 deleted the jguo144/2026-04-30/update-clear-flag branch May 1, 2026 19:37
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