refactor(getobject): scope downstream close tagging (#5224)

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-07-25 17:36:19 +08:00
committed by GitHub
parent 2ee111ad8b
commit 2dc4d0b651
4 changed files with 18 additions and 100 deletions
-18
View File
@@ -1500,9 +1500,6 @@ impl<R> GetObjectStreamingReader<R> {
{
return "read_quorum";
}
if error_msg.contains("getobject output closed:") {
return "downstream_closed";
}
}
match err.kind() {
@@ -10604,21 +10601,6 @@ mod tests {
assert_eq!(err.kind(), std::io::ErrorKind::TimedOut);
}
#[test]
fn get_object_streaming_reader_distinguishes_internal_and_output_broken_pipes() {
let internal = std::io::Error::from(std::io::ErrorKind::BrokenPipe);
assert_eq!(GetObjectStreamingReader::<std::io::Cursor<Vec<u8>>>::classify_read_error(&internal), "io");
let output_closed = std::io::Error::new(
std::io::ErrorKind::BrokenPipe,
std::io::Error::other("GetObject output closed: broken pipe"),
);
assert_eq!(
GetObjectStreamingReader::<std::io::Cursor<Vec<u8>>>::classify_read_error(&output_closed),
"downstream_closed"
);
}
#[tokio::test]
async fn put_object_body_read_timeout_guard_aborts_on_stall() {
// Inner stream never yields and never reports EOF (a proxy that forwarded