alluxio
alluxio copied to clipboard
Sent headObject get stuck after getObject request of alluxio-proxy v2
Alluxio Version: 2.9
Describe the bug
Using go aws sdk, first call getObject, then call headObject, and the request is stuck.
Found exceptions in proxy log.
To Reproduce
import (
"fmt"
"os"
"io"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/aws/credentials"
)
func main() {
sess, err := session.NewSession(&aws.Config{
Region: aws.String("default"),
Credentials: credentials.NewStaticCredentials(
"xxx", "xxx", "TOKEN"),
Endpoint: aws.String("http://localhost:39999"),
S3ForcePathStyle: aws.Bool(true),
})
if err != nil {
_ = fmt.Errorf(err.Error())
}
bucket := "get_test"
item := "bigfile.txt"
file, err := os.Create("bigfile.txt")
defer file.Close()
object := s3.GetObjectInput{
Bucket: aws.String(bucket),
Key: aws.String(item),
}
s3Client := s3.New(sess)
result, err := s3Client.GetObject(&object)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
defer result.Body.Close()
_, err = io.Copy(file, result.Body)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
if err != nil {
fmt.Println("Unable to get item %q, %v", item, err)
}
input := s3.HeadObjectInput{
Bucket: aws.String(bucket),
Key:aws.String(item),
}
_, err2 := s3Client.HeadObject(&input)
if err2 != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
fmt.Println("finish")
}
Expected behavior Requests are going well.
Are you planning to fix it Yes.
@yyongycy @Jackson-Wang-7 Please help review the issue and solution.
wondering whether this error exists in 2.10?
wondering whether this error exists in 2.10?
This is an issue if async
is enabled and the entire large file is uploaded in a single request.
wondering whether this error exists in 2.10?
@yyongycy This issue has been around for a long time. https://github.com/Alluxio/alluxio/pull/17267