mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-08 14:23:13 +00:00
refactor(getobject): scope downstream close tagging (#5224)
Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user