Repository navigation
fix: remove safe.block from upload_log to enable transport-layer retry - #1716
Merged
Merged
Conversation
The mock_metrics_api fixture was missing from several test methods and fixtures in TestInitOnlineMode, causing test failures when the metrics endpoint is called during online init.
Nexisato
approved these changes
Jul 29, 2026
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.
Summary
upload_log方法被safe.block()包裹,导致ApiError异常被静默吞掉,transport 层的重试机制对日志上传完全失效。本次变更移除safe.block,使upload_log的错误传播行为与upload_scalar、upload_media保持一致——ApiError正确穿透到upload()dispatcher,由后者根据状态码决定重试(5xx re-raise)或放弃(4xx swallow)。Changes
swanlab/sdk/internal/core_python/transport/sender.py: 移除upload_log方法的safe.block包裹,解除因异常被静默吞掉导致的日志上传重试失效问题。tests/unit/sdk/internal/core_python/transport/test_sender_retry.py(新增): 重试契约测试,覆盖:retries=0约定:验证所有上传 API 的 HTTP 层不自行重试uploaded_records正确推进Testing