Skip to content

Comments

version to v7.25.6#181

Merged
YangSen-qn merged 2 commits intoqiniu:masterfrom
YangSen-qn:master
Jan 13, 2026
Merged

version to v7.25.6#181
YangSen-qn merged 2 commits intoqiniu:masterfrom
YangSen-qn:master

Conversation

@YangSen-qn
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @YangSen-qn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求主要将项目版本升级到 v7.25.6,并集成了对 SDK 不同组件的关键错误修复,同时增强了 storagev2 模块的重试逻辑,以提高其在特定错误情况下的健壮性。

Highlights

  • 版本更新: 项目版本已从 v7.25.5 更新至 v7.25.6
  • 错误修复: 此版本包含多项错误修复,包括 pfop 响应字段补全、storage v1 包在专有云场景下 bucket 服务访问问题,以及 storage v2 包的 data race 问题。
  • 重试逻辑增强: storagev2 模块的重试机制现在会将 io.EOF 错误视为可重试的请求错误。

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

本次代码审查主要关注版本号升级至 v7.25.6 的相关改动。整体来看,版本号的更新、CHANGELOG 的记录以及在 retrier 中增加 io.EOF 的重试逻辑都是合理的。我提出了一些关于代码格式和文件规范的建议,旨在提高代码库的一致性和可维护性,具体请见文件中的评论。

}
return DontRetry
}
} No newline at end of file

Choose a reason for hiding this comment

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

medium

文件末尾缺少换行符。根据 Go 的编码惯例以及为了兼容一些 POSIX 工具,建议在文件末尾添加一个换行符。

Suggested change
}
}

} else if os.IsTimeout(unwrapedErr) {
return RetryRequest
} else if unwrapedErr == io.EOF {
return RetryRequest
Copy link
Contributor

Choose a reason for hiding this comment

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

Semantic Concern: Retrying io.EOF May Be Incorrect

Treating io.EOF as retryable contradicts Go's standard semantics. Per Go docs, io.EOF signals a graceful end of input, not an error. Normal EOFs (server closes connection after complete response) will trigger unnecessary retries.

Issues:

  • Retry storms: Legitimate EOFs will retry 3x per host across multiple hosts (6-12+ total attempts)
  • Performance: Adds 150-300ms latency overhead per request
  • Resource waste: Large uploads re-buffer on each retry

Suggestion: Consider using io.ErrUnexpectedEOF instead, or add context checking to only retry EOF during request phase (not after response headers received). If EOF retry is intentional for specific scenarios, please add a code comment explaining why.

Note: The code already handles "unexpected EOF" via string matching at line 183.

} else if os.IsTimeout(unwrapedErr) {
return RetryRequest
} else if unwrapedErr == io.EOF {
return RetryRequest
Copy link
Contributor

Choose a reason for hiding this comment

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

Security: Potential DoS Amplification

Malicious servers can exploit this by repeatedly sending premature EOFs, forcing clients to retry up to 3 retries × N hosts times per request. For large file uploads, this amplifies bandwidth consumption and memory usage.

Mitigations needed:

  1. Add request body size limits for EOF retries (e.g., skip retry for requests >10MB)
  2. Implement exponential backoff for EOF retries instead of fixed 50-100ms delay
  3. Consider rate limiting or circuit breaker per endpoint

Current safeguards (context deadlines, retry limits) help but don't fully prevent resource exhaustion.

@xgopilot
Copy link
Contributor

xgopilot bot commented Jan 13, 2026

CHANGELOG Documentation Issues

The CHANGELOG is missing the main code change and contains inaccuracies:

Missing: The io.EOF retry fix (commit d7ec7dc) - the actual functional change in this release
Incorrect: "storage v1 包专有云场景 bucket 服务访问问题" was already fixed in v7.25.5, not v7.25.6
Incomplete: Two separate data race fixes (PR #173 resolver, PR #171 uptoken) are listed as one generic entry

Please update CHANGELOG to accurately reflect all 5 commits in this release.

@YangSen-qn YangSen-qn merged commit 02b15b4 into qiniu:master Jan 13, 2026
19 checks passed
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.

1 participant