Skip to content

Commit a1702df

Browse files
authored
fix: consume mountpoint-s3-client 0.14.1 (#332)
Update to mountpoint-s3-client v0.14.1 to address CRT timeout issues and adapt to API changes: - Include aws-c-s3 first byte timeout fix (awslabs/aws-c-s3/pull/461) - Update get_object functions to use new GetBodyPart type (awslabs/mountpoint-s3/pull/1348) This addresses AWS_ERROR_HTTP_RESPONSE_FIRST_BYTE_TIMEOUT CRT error.
1 parent 08b087d commit a1702df

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

s3torchconnectorclient/Cargo.lock

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

s3torchconnectorclient/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ built = "0.7"
1818
[dependencies]
1919
pyo3 = "0.24.1"
2020
futures = "0.3.28"
21-
mountpoint-s3-client = { version = "0.13.3", features = ["mock"] }
21+
mountpoint-s3-client = { version = "0.14.1", features = ["mock"] }
2222
mountpoint-s3-crt-sys = { version = "0.13.0" }
2323
log = "0.4.20"
2424
tracing = { version = "0.1.40", default-features = false, features = ["std", "log"] }

s3torchconnectorclient/rust/src/get_object_stream.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use pyo3::types::PyBytes;
77
use pyo3::{pyclass, pymethods, Bound, PyRef, PyRefMut, PyResult};
8+
use mountpoint_s3_client::types::GetBodyPart;
89

910
use crate::exception::S3Exception;
1011
use crate::mountpoint_s3_client_inner::MPGetObjectClosure;
@@ -45,7 +46,7 @@ impl GetObjectStream {
4546
let body_part = (slf.next_part)(py)?;
4647
match body_part {
4748
None => Ok(None),
48-
Some((offset, data)) => {
49+
Some(GetBodyPart { offset, data }) => {
4950
if offset != slf.offset {
5051
return Err(S3Exception::new_err(
5152
"Data from S3 was returned out of order!",

s3torchconnectorclient/rust/src/mountpoint_s3_client_inner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::sync::Arc;
77

88
use futures::executor::block_on;
99
use futures::TryStreamExt;
10-
use mountpoint_s3_client::types::{CopyObjectParams, GetObjectParams, HeadObjectParams, ListObjectsResult, PutObjectParams};
10+
use mountpoint_s3_client::types::{GetBodyPart, CopyObjectParams, GetObjectParams, HeadObjectParams, ListObjectsResult, PutObjectParams};
1111
use mountpoint_s3_client::ObjectClient;
1212
use pyo3::{PyResult, Python};
1313

@@ -17,7 +17,7 @@ use crate::put_object_stream::PutObjectStream;
1717
use crate::python_structs::py_head_object_result::PyHeadObjectResult;
1818

1919
pub type MPGetObjectClosure =
20-
Box<dyn FnMut(Python) -> PyResult<Option<(u64, Box<[u8]>)>> + Send + Sync>;
20+
Box<dyn FnMut(Python) -> PyResult<Option<GetBodyPart>> + Send + Sync>;
2121

2222
/// We need an extra trait here, as pyo3 doesn't support structs with generics.
2323
/// However, it does allow dynamic traits. We can't ues `ObjectClient` itself, as that requires

0 commit comments

Comments
 (0)