Merge pull request #7 from markhpc/wip-read-bodyclose

hsbench: Close the resp body instead of copying to ioutil.Discard
master
Mark Nelson 2019-08-20 07:02:02 -05:00 committed by GitHub
commit 6176271af8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 6 deletions

View File

@ -20,8 +20,6 @@ import (
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"io"
"io/ioutil"
"log"
"math"
"math/rand"
@ -548,13 +546,10 @@ func runDownload(thread_num int, fendtime time.Time, stats *Stats) {
stats.addSlowDown(thread_num)
log.Printf("download err", err)
} else {
resp.Body.Close()
// Update the stats
stats.addOp(thread_num, object_size, end-start)
}
if err == nil {
_, err = io.Copy(ioutil.Discard, resp.Body)
}
if errcnt > 2 {
break
}