alluxio icon indicating copy to clipboard operation
alluxio copied to clipboard

Sent headObject get stuck after getObject request of alluxio-proxy v2

Open Haoning-Sun opened this issue 1 year ago • 4 comments

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. image

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.

Haoning-Sun avatar Dec 04 '23 07:12 Haoning-Sun

@yyongycy @Jackson-Wang-7 Please help review the issue and solution.

Haoning-Sun avatar Dec 05 '23 01:12 Haoning-Sun

wondering whether this error exists in 2.10?

yyongycy avatar Dec 05 '23 02:12 yyongycy

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.

Haoning-Sun avatar Dec 05 '23 03:12 Haoning-Sun

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

humengyu2012 avatar Dec 07 '23 05:12 humengyu2012