mirror of
				https://github.com/minio/minio.git
				synced 2025-10-29 15:55:00 -04:00 
			
		
		
		
	Avoid printing i/o closed pipe error message (#6654)
Since refactoring to GetObjectNInfo style, there are many cases when i/o closed pipe is printed like, downloading an object with wrong encryption key. This PR removes the log.
This commit is contained in:
		
							parent
							
								
									cef044178c
								
							
						
					
					
						commit
						ae3c05aa37
					
				| @ -20,7 +20,6 @@ import ( | ||||
| 	"bytes" | ||||
| 	"context" | ||||
| 	"io" | ||||
| 	"strings" | ||||
| 
 | ||||
| 	"github.com/klauspost/reedsolomon" | ||||
| 	"github.com/minio/minio/cmd/logger" | ||||
| @ -82,7 +81,9 @@ func writeDataBlocks(ctx context.Context, dst io.Writer, enBlocks [][]byte, data | ||||
| 		if write < int64(len(block)) { | ||||
| 			n, err := io.Copy(dst, bytes.NewReader(block[:write])) | ||||
| 			if err != nil { | ||||
| 				logger.LogIf(ctx, err) | ||||
| 				if err != io.ErrClosedPipe { | ||||
| 					logger.LogIf(ctx, err) | ||||
| 				} | ||||
| 				return 0, err | ||||
| 			} | ||||
| 			totalWritten += n | ||||
| @ -92,7 +93,7 @@ func writeDataBlocks(ctx context.Context, dst io.Writer, enBlocks [][]byte, data | ||||
| 		n, err := io.Copy(dst, bytes.NewReader(block)) | ||||
| 		if err != nil { | ||||
| 			// The writer will be closed incase of range queries, which will emit ErrClosedPipe. | ||||
| 			if !strings.Contains(err.Error(), "read/write on closed pipe") { | ||||
| 			if err != io.ErrClosedPipe { | ||||
| 				logger.LogIf(ctx, err) | ||||
| 			} | ||||
| 			return 0, err | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user