Fix simple repository export

This commit is contained in:
Rene Pfeuffer
2025-09-22 11:26:46 +02:00
committed by Florian Scholdei
parent 017e1c96fe
commit 9c5e9adbb4
3 changed files with 10 additions and 2 deletions

View File

@@ -0,0 +1,2 @@
- type: fixed
description: Export of repositories

View File

@@ -52,7 +52,7 @@ public final class DefaultRepositoryExportingCheck implements RepositoryExportin
} finally {
int lockCount = getLockCount(repository.getId()).decrementAndGet();
if (lockCount <= 0) {
LOG.warn("Got negative export lock count {} for repository {}", lockCount, repository);
LOG.debug("Lock count {} for repository {}", lockCount, repository);
EXPORTING_REPOSITORIES.remove(repository.getId());
}
}

View File

@@ -43,6 +43,7 @@ import jakarta.ws.rs.core.UriInfo;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream;
import sonia.scm.BadRequestException;
import sonia.scm.ConcurrentModificationException;
@@ -78,6 +79,7 @@ import static sonia.scm.ContextEntry.ContextBuilder.entity;
import static sonia.scm.importexport.RepositoryTypeSupportChecker.checkSupport;
import static sonia.scm.importexport.RepositoryTypeSupportChecker.type;
@Slf4j
public class RepositoryExportResource {
private static final String NO_PASSWORD = "";
@@ -484,7 +486,11 @@ public class RepositoryExportResource {
if (compressed) {
GzipCompressorOutputStream gzipCompressorOutputStream = new GzipCompressorOutputStream(os);
bundleCommand.bundle(gzipCompressorOutputStream);
gzipCompressorOutputStream.finish();
try {
gzipCompressorOutputStream.finish();
} catch (NullPointerException e) {
log.info("Could not finish gzip stream", e);
}
} else {
bundleCommand.bundle(os);
}