Skip to content

Comments

[pull] main from SwanHubX:main#151

Merged
pull[bot] merged 1 commit intoxj63:mainfrom
SwanHubX:main
Dec 12, 2025
Merged

[pull] main from SwanHubX:main#151
pull[bot] merged 1 commit intoxj63:mainfrom
SwanHubX:main

Conversation

@pull
Copy link

@pull pull bot commented Dec 12, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

* Refactor COS upload and experiment state APIs

Removed boto3/botocore dependencies and the CosClient, replacing direct COS upload logic with a new API-based approach using presigned URLs. Moved experiment state update logic to a dedicated API module and updated all usages. Refactored Client to remove COS logic, simplified session handling, and updated uploader and callback code to use the new APIs. Updated imports and tests to reflect file moves and API changes.

* Reset buffer pointer before COS upload

Added buffer.seek(0) before uploading to COS to ensure the buffer pointer is at the start. Also removed unused COS upload tests and related imports from test_client.py for code cleanup.

* Move buffer seek to _upload function

Relocated the buffer.seek(0) call from upload_to_cos to the _upload function to ensure the buffer is reset before uploading. This centralizes buffer handling and prevents redundant seeks.

* Add retry logic to file upload and unit tests

Enhanced the file upload function with retry logic and exponential backoff for robustness against network errors. Added comprehensive unit tests to verify upload success, retry behavior, exception handling, and server error scenarios.

* Improve error handling in COS upload function

Enhanced the upload_to_cos function to better handle exceptions during concurrent uploads. Failed uploads are now logged with warnings and retried, with errors on retry attempts also logged for improved reliability and debugging.

* Improve retry backoff in upload_file function

Changed the retry delay in upload_file to use exponential backoff (2^(attempt-1) seconds) instead of linear. Also removed a redundant comment in upload_to_cos for clarity.

* Remove unused import and URL prefix logic

Deleted the import of get_host_api and related code that handled URL prefixing for private environments, as it is no longer needed.
@pull pull bot locked and limited conversation to collaborators Dec 12, 2025
@pull pull bot added the ⤵️ pull label Dec 12, 2025
@pull pull bot merged commit ed3c13a into xj63:main Dec 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant