Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Head command hangs #6477

Open
3 of 4 tasks
Hristosko opened this issue Sep 16, 2024 · 2 comments
Open
3 of 4 tasks

Head command hangs #6477

Hristosko opened this issue Sep 16, 2024 · 2 comments
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. third-party This issue is related to third-party libraries or applications.

Comments

@Hristosko
Copy link

Hristosko commented Sep 16, 2024

Checkboxes for prior research

Describe the bug

Executing the sequence head, put, head for the same object that initially doesn't exist lead to a hang in the second head call

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/[email protected]

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

node v18.18.0

Reproduction Steps

import { HeadObjectCommand, PutObjectCommand, S3Client, S3ClientConfig } from '@aws-sdk/client-s3';
import { expect, test } from 'vitest';

describe('AWS hang', () => {
    const s3Config: S3ClientConfig = {
        region: 'us-east-1',
        credentials: {
            accessKeyId: '***',
            secretAccessKey: '***',
        },
        tls: true,
        forcePathStyle: true,
        endpoint: 'https://localhost:11801',
    };

    const s3Client = new S3Client(s3Config);
    const bucketName = 'default-bucket-name';
    const key = 'some_key';

    test('repro', async () => {
        await expect(s3Client.send(new HeadObjectCommand({ Bucket: bucketName, Key: key }))).rejects.toThrow();
        await expect(
            s3Client.send(new PutObjectCommand({ Bucket: bucketName, Key: key, Body: new Uint8Array() })),
        ).rejects.toThrow();
        await expect(s3Client.send(new HeadObjectCommand({ Bucket: bucketName, Key: key }))).rejects.toThrow();
    });
});

Observed Behavior

The second head request hangs and we never get the expected error. This is reproducible with MinIO as backed server, It only happens with HTTPS, the test passes if we use HTTP. forcePathStyle doesn't make any difference. However the test passes if we use an actual object store, not MinIO.
We have the same scenario implemented with the C++ SDK and it works with MinIO.
The problem seems to be in the state of the client as if we create a new client the head request doesn't hang.
The issue persists if the bucket exists.

The issue is reproducible with version 3.588.0 and the latest 3.651.1

Expected Behavior

The second head request should return an error

Possible Solution

No response

Additional Information/Context

No response

@Hristosko Hristosko added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 16, 2024
@aBurmeseDev
Copy link
Member

Hi @Hristosko - thanks for reaching out.

This is reproducible with MinIO as backed server, It only happens with HTTPS, the test passes if we use HTTP. forcePathStyle doesn't make any difference. However the test passes if we use an actual object store, not MinIO.
We have the same scenario implemented with the C++ SDK and it works with MinIO.

It sounds like this issue is specific to MinIO rather than AWS SDK as the problem does not occur when using HTTP or a different object store. Are you able to verify it with other SDKs besides C++?

@aBurmeseDev aBurmeseDev self-assigned this Sep 16, 2024
@aBurmeseDev aBurmeseDev added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. third-party This issue is related to third-party libraries or applications. p3 This is a minor priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Sep 16, 2024
@Hristosko
Copy link
Author

Hi, @aBurmeseDev
I could try with different SDK but it will take some time. Do you have any specific one in mind.
The problem could be specific to MinIO however there is no way to test every single store out there.
This seems to be an issue with the state of the client imo, because if we use a second client to make the second head request it works. As we will have to use this in production, we want to make sure that it works and as of now we have to pretty much delete the tests with HTTPS. Which is a bit risky.
It would be fine if we know for sure the issue is caused by MinIO but currently I doubt it.
From the tests with the second client and the c++ SDK we know MinIO is responding. And the only difference is in the SDK behavior.
Ideally what I would like is to either make 100% sure the issue is from MinIO or fix the issue as this would be a nasty thing to happen in producion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. third-party This issue is related to third-party libraries or applications.
Projects
None yet
Development

No branches or pull requests

2 participants