Skip to content

Head command hangs #6477

@Hristosko

Description

@Hristosko

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

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.closed-for-stalenessp3This is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.third-partyThis issue is related to third-party libraries or applications.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions