Skip to content

fix(115_open): refresh expired OSS credentials during upload - #3063

Open
xqmmcqs wants to merge 1 commit into
OpenListTeam:mainfrom
xqmmcqs:fix/115-open-upload-token-expired
Open

fix(115_open): refresh expired OSS credentials during upload#3063
xqmmcqs wants to merge 1 commit into
OpenListTeam:mainfrom
xqmmcqs:fix/115-open-upload-token-expired

Conversation

@xqmmcqs

@xqmmcqs xqmmcqs commented Sep 10, 2026

Copy link
Copy Markdown

Summary / 摘要

Long-running 115 Open uploads fail when OSS credentials expire because retries keep using the original credentials. Refresh credentials on SecurityTokenExpired and retry the rejected multipart initiation, part upload, or completion once, preserving the upload ID, completed parts, and callbacks.

Part uploads retain their three outer attempts; each can make one additional attempt after refreshing expired credentials. Rewind the current part before resending it and pass the upload context to OSS requests. This PR changes only drivers/115_open/upload.go.

  • This PR has breaking changes.
  • This PR changes public API, config, storage format, or migration behavior.
  • This PR requires corresponding changes in related repositories.

Related repository PRs / 关联仓库 PR: None.

Related Issues / 关联 Issue

Fixes #1376

Testing / 测试

Linux amd64, Go 1.27.1 in Docker:

  • go test -tags=jsoniter ./drivers/115_open -count=1 passed with local, untracked tests. Those tests are not included in this PR. They exercise credential replacement and retries for multipart initiation, part upload, and completion, plus non-expiration errors and refresh failures.
  • git diff --check passed.
  • Before the refresh-closure refactor, driver race tests, a full application/image build, and container /ping and frontend checks passed. The image was not rebuilt after that refactor.
  • A related network-package test, TestNewOSSClientUsesEnvironmentHTTPSProxy, fails because it expects *http.Transport but receives *net.safeTransport. This was also reproduced on the unmodified base checkout.
  • go test ./... — not run; validation focused on the affected driver and related network package.
  • Manual test / 手动测试: Real 115 uploads spanning credential expiry have not been verified.

Checklist / 检查清单

  • I have read CONTRIBUTING.
  • I confirm this contribution follows the repository license, contribution policy, and code of conduct.
  • I have formatted the changed code with gofmt, go fmt, or prettier where applicable.
  • I have requested review from relevant maintainers or code owners where applicable.

AI Disclosure / AI 使用声明

  • This PR includes AI-assisted content.

Tools used / 使用工具:

  • Codex

Usage scope / 使用范围:

  • Code generation / 代码生成

  • Refactoring / 重构

  • Documentation / 文档 — commit and PR descriptions

  • Tests / 测试 — local validation only; test files are not included

  • Review assistance / 审查辅助

  • I have reviewed and validated all AI-assisted content included in this PR.

  • I have ensured that all AI-assisted commits include Co-Authored-By attribution.

  • I can reproduce all AI-assisted content included in this PR without any AI tools.

Codex implemented the change and performed the validation described above at the contributor's request. Human attestations not established during this work remain unchecked.

- Refresh OSS credentials and retry the rejected multipart operation
- Preserve upload IDs, completed parts, callbacks, and outer part retries
- Rewind parts before resending and pass the upload context to OSS requests

Co-authored-by: Codex <267193182+codex@users.noreply.github.com>
@xqmmcqs
xqmmcqs force-pushed the fix/115-open-upload-token-expired branch from f986a05 to ab23d1f Compare September 10, 2026 00:35
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.

[BUG] 115open驱动上传大文件失败,提示token expired

1 participant