Skip to content

Commit 9e271e2

Browse files
committed
Remove S3 checksum options from R2 and SeaweedFS clients
Eliminated S3 checksum calculation and validation settings from both R2 and SeaweedFS connection builders in axumkit-server and axumkit-worker. This avoids potential panics on CPUs lacking SSE4.1/PCLMULQDQ support. Updated workspace and crate versions to 0.2.2.
1 parent e7f833c commit 9e271e2

7 files changed

Lines changed: 17 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.2.2] - 2025-01-20
9+
10+
### Removed
11+
12+
- S3 checksum calculation/validation for SeaweedFS and R2 connections
13+
- Removed `RequestChecksumCalculation::WhenRequired` from SeaweedFS client
14+
- Removed `RequestChecksumCalculation::WhenRequired` and `ResponseChecksumValidation::WhenRequired` from R2 client
15+
- Applies to both `axumkit-server` and `axumkit-worker`

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ resolver = "2"
33
members = ["crates/*"]
44

55
[workspace.package]
6-
version = "0.2.1"
6+
version = "0.2.2"
77
authors = ["Levi Laine <shiueo.csh@gmail.com>"]
88
repository = "https://github.com/levish0/AxumKit"
99
edition = "2024"

crates/axumkit-server/src/connection/r2_conn.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use aws_config::{BehaviorVersion, Region};
2-
use aws_sdk_s3::config::{RequestChecksumCalculation, ResponseChecksumValidation};
32
use aws_sdk_s3::error::SdkError;
43
use aws_sdk_s3::{Client, Error as S3Error};
54
use axumkit_config::ServerConfig;
@@ -138,12 +137,8 @@ pub async fn establish_r2_connection() -> Result<R2Client, Box<dyn std::error::E
138137
.load()
139138
.await;
140139

141-
// Enable path-style addressing for R2 (required for S3-compatible services with custom endpoints)
142-
// Disable checksum calculation to avoid crc-fast panic on CPUs without SSE4.1/PCLMULQDQ
143140
let s3_config = aws_sdk_s3::config::Builder::from(&aws_config)
144141
.force_path_style(true)
145-
.request_checksum_calculation(RequestChecksumCalculation::WhenRequired)
146-
.response_checksum_validation(ResponseChecksumValidation::WhenRequired)
147142
.build();
148143

149144
let client = Client::from_conf(s3_config);

crates/axumkit-server/src/connection/seaweedfs_conn.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use aws_config::{BehaviorVersion, Region};
2-
use aws_sdk_s3::config::RequestChecksumCalculation;
32
use aws_sdk_s3::error::SdkError;
43
use aws_sdk_s3::{Client, Error as S3Error};
54
use axumkit_config::ServerConfig;
@@ -157,7 +156,6 @@ pub async fn establish_seaweedfs_connection()
157156

158157
let s3_config = aws_sdk_s3::config::Builder::from(&aws_config)
159158
.force_path_style(true)
160-
.request_checksum_calculation(RequestChecksumCalculation::WhenRequired)
161159
.build();
162160

163161
let client = Client::from_conf(s3_config);

crates/axumkit-worker/src/connection/r2_conn.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::config::WorkerConfig;
22
use aws_config::{BehaviorVersion, Region};
3-
use aws_sdk_s3::config::{RequestChecksumCalculation, ResponseChecksumValidation};
43
use aws_sdk_s3::error::SdkError;
54
use aws_sdk_s3::{Client, Error as S3Error};
65
use std::sync::Arc;
@@ -155,12 +154,8 @@ pub async fn establish_r2_connection(config: &WorkerConfig) -> anyhow::Result<R2
155154
.load()
156155
.await;
157156

158-
// Enable path-style addressing for R2 (required for S3-compatible services with custom endpoints)
159-
// Disable checksum calculation to avoid crc-fast panic on CPUs without SSE4.1/PCLMULQDQ
160157
let s3_config = aws_sdk_s3::config::Builder::from(&aws_config)
161158
.force_path_style(true)
162-
.request_checksum_calculation(RequestChecksumCalculation::WhenRequired)
163-
.response_checksum_validation(ResponseChecksumValidation::WhenRequired)
164159
.build();
165160

166161
let client = Client::from_conf(s3_config);

crates/axumkit-worker/src/connection/seaweedfs_conn.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::config::WorkerConfig;
22
use aws_config::{BehaviorVersion, Region};
33
use aws_sdk_s3::Client;
4-
use aws_sdk_s3::config::RequestChecksumCalculation;
54
use std::sync::Arc;
65
use tracing::info;
76

@@ -121,7 +120,6 @@ pub async fn establish_seaweedfs_connection(
121120

122121
let s3_config = aws_sdk_s3::config::Builder::from(&aws_config)
123122
.force_path_style(true)
124-
.request_checksum_calculation(RequestChecksumCalculation::WhenRequired)
125123
.build();
126124

127125
let client = Client::from_conf(s3_config);

0 commit comments

Comments
 (0)