Skip to content

Commit

Permalink
Merge pull request #256 from wellcomecollection/S3StreamWritable-bug-fix
Browse files Browse the repository at this point in the history
S3StreamWritable bug fix
  • Loading branch information
StepanBrychta authored Oct 7, 2024
2 parents 54abc18 + 197d6a2 commit 4f4a367
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ jobs:
runs-on: ubuntu-latest
needs: create-release
strategy:
fail-fast: false
matrix:
service:
- fixtures
- http
- http_typesafe
- json
- typesafe_app
- monitoring
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/report-evictions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
service:
- fixtures
- http
- http_typesafe
- json
- typesafe_app
- monitoring
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
service:
- fixtures
- http
- http_typesafe
- json
- typesafe_app
- monitoring
Expand Down
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
RELEASE_TYPE: patch

S3StreamWritable bug fix (replace `read` by `readNBytes`).
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ trait S3StreamWritable
if (inputStream.length > 0) {
val bytes: Array[Byte] = new Array[Byte](inputStream.length.toInt)
val bytesRead =
inputStream.read(bytes, 0, inputStream.length.toInt)
inputStream.readNBytes(bytes, 0, inputStream.length.toInt)

if (bytesRead < inputStream.length) {
throw new RuntimeException(
Expand Down Expand Up @@ -93,7 +93,7 @@ trait S3StreamWritable
val partLength = (end - start).toInt

val bytes: Array[Byte] = new Array[Byte](partLength)
val bytesRead = inputStream.read(bytes, 0, partLength)
val bytesRead = inputStream.readNBytes(bytes, 0, partLength)

if (bytesRead < partLength) {
throw new RuntimeException(
Expand Down

0 comments on commit 4f4a367

Please sign in to comment.