Skip to content
Open
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ class DatasetResource {
URLDecoder.decode(encodedFilePath, StandardCharsets.UTF_8.name())
)

withTransaction(context) { ctx =>
val (repoName, uploadId, physicalAddr) = withTransaction(context) { ctx =>
if (!userHasWriteAccess(ctx, did, uid)) {
throw new ForbiddenException(ERR_USER_HAS_NO_ACCESS_TO_DATASET_MESSAGE)
}
Expand Down Expand Up @@ -2030,21 +2030,6 @@ class DatasetResource {
}

val physicalAddr = Option(session.getPhysicalAddress).map(_.trim).getOrElse("")
if (physicalAddr.isEmpty) {
throw new WebApplicationException(
"Upload session is missing physicalAddress. Restart the upload.",
Response.Status.INTERNAL_SERVER_ERROR
)
}

withLakeFSErrorHandling {
LakeFSStorageClient.abortPresignedMultipartUploads(
dataset.getRepositoryName,
filePath,
session.getUploadId,
physicalAddr
)
}

// Delete session; parts removed via ON DELETE CASCADE
ctx
Expand All @@ -2057,8 +2042,14 @@ class DatasetResource {
)
.execute()

Response.ok(Map("message" -> "Multipart upload aborted successfully")).build()
(dataset.getRepositoryName, session.getUploadId, physicalAddr)
}

withLakeFSErrorHandling {
LakeFSStorageClient.abortPresignedMultipartUploads(repoName, filePath, uploadId, physicalAddr)
}

Response.ok(Map("message" -> "Multipart upload aborted successfully")).build()
}

/**
Expand Down