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

feat: introduce timeout to s3 read requests #5504

Merged
merged 2 commits into from
Aug 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/services/cdn-worker/src/artifact-storage-reader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ type SDLArtifactTypes = `sdl${'.graphql' | '.graphqls' | ''}`;

export type ArtifactsType = SDLArtifactTypes | 'metadata' | 'services' | 'supergraph';

/** Timeout in milliseconds for S3 read calls. */
const READ_TIMEOUT_MS = 20_000;
kamilkisiela marked this conversation as resolved.
Show resolved Hide resolved
kamilkisiela marked this conversation as resolved.
Show resolved Hide resolved

const OperationS3BucketKeyModel = zod.tuple([
zod.string().uuid(),
zod.string().min(1),
Expand Down Expand Up @@ -85,6 +88,7 @@ export class ArtifactStorageReader {
headers: {
'X-Amz-Expires': String(presignedUrlExpirationSeconds),
},
timeout: READ_TIMEOUT_MS,
},
);

Expand Down Expand Up @@ -126,6 +130,7 @@ export class ArtifactStorageReader {
aws: {
signQuery: true,
},
timeout: READ_TIMEOUT_MS,
},
);
this.analytics?.track(
Expand Down Expand Up @@ -164,6 +169,7 @@ export class ArtifactStorageReader {
aws: {
signQuery: true,
},
timeout: READ_TIMEOUT_MS,
},
);
this.analytics?.track(
Expand Down Expand Up @@ -200,6 +206,7 @@ export class ArtifactStorageReader {
signQuery: true,
},
headers,
timeout: READ_TIMEOUT_MS,
},
);

Expand Down
Loading