-
Notifications
You must be signed in to change notification settings - Fork 8
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
Prevent socket exhaustion in BlobStorageS3Storage
#2666
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
thomasdax98
force-pushed
the
add-timeout-for-s3-blob-storage
branch
5 times, most recently
from
November 6, 2024 22:59
389cc62
to
e40c190
Compare
thomasdax98
changed the title
Draft: Add timeout for s3 blob storage
Prevent socket exhaustion in Nov 6, 2024
BlobStorageS3Storage
thomasdax98
force-pushed
the
add-timeout-for-s3-blob-storage
branch
from
November 6, 2024 23:08
2dd76b3
to
f7ef856
Compare
…to Readable This is non-breaking because Readable implements ReadableStream
thomasdax98
force-pushed
the
add-timeout-for-s3-blob-storage
branch
from
November 6, 2024 23:26
f7ef856
to
a2b6d81
Compare
thomasdax98
commented
Nov 6, 2024
packages/api/cms-api/src/blob-storage/backends/blob-storage-backend.interface.ts
Show resolved
Hide resolved
nsams
reviewed
Nov 7, 2024
packages/api/cms-api/src/blob-storage/backends/s3/blob-storage-s3.storage.ts
Outdated
Show resolved
Hide resolved
johnnyomair
reviewed
Nov 11, 2024
johnnyomair
approved these changes
Nov 12, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The relevant changes are in commits 5cb03df and a47c547
Description
Prevent socket exhaustion in
BlobStorageS3Storage
Problem
By default, the S3 client allows a maximum of 50 open sockets.
A socket is only released once a file is streamed completely.
Meaning, it can remain open forever if a file stream is interrupted (e.g., when the user leaves the site).
This could lead to socket exhaustion, preventing further file delivery:
Solution
To resolve this, the following changes were made:
requestTimeout
to close unused connections.Changeset
Related tasks and documents
https://vivid-planet.atlassian.net/browse/COM-1229
Further information
The change from
ReadableStream
toReadable
in theBlobStorageBackendInterface
is not a breaking change becauseReadable
implementsReadableStream
:TODO