Skip to content

Commit

Permalink
Fixed related to feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-ry4n committed Oct 13, 2024
1 parent a88e4c4 commit 7fbf16a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ protected SafeFuture<?> doStart() {
final DataArchive dataArchive =
config
.getBlobsArchivePath()
.map(path -> (DataArchive) new FileSystemArchive(Path.of(path)))
.<DataArchive>map(path -> new FileSystemArchive(Path.of(path)))
.orElse(new NoopDataArchive());

if (config.getSpec().isMilestoneSupported(SpecMilestone.DENEB)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import tech.pegasys.teku.spec.datastructures.blobs.versions.deneb.BlobSidecar;

/**
* Interface for a data archive which stores non-current BlobSidecars and could be extended later to
* include other data types. It is expected that the DataArchive is on disk or externally stored
* with slow write and recovery times. Initial interface is write only, but may be expanded to
* include read operations later.
* Interface for a data archive which stores prunable BlobSidecars outside the data availability
* window and could be extended later to include other data types. It is expected that the
* DataArchive is on disk or externally stored with slow write and recovery times. Initial interface
* is write only, but may be expanded to include read operations later.
*/
public interface DataArchive {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ public boolean archive(final List<BlobSidecar> blobSidecars) {
final SlotAndBlockRoot slotAndBlockRoot = blobSidecars.getFirst().getSlotAndBlockRoot();
final File file = resolve(slotAndBlockRoot);
if (file.exists()) {
LOG.warn("Failed to write BlobSidecar. File exists: {}", file.toString());
LOG.error("Failed to write BlobSidecar. File exists: {}", file.toString());
return false;
}

try {
Files.createDirectories(file.toPath().getParent());
} catch (IOException e) {
LOG.warn(
LOG.error(
"Failed to write BlobSidecar. Could not make directories to: {}",
file.getParentFile().toString());
return false;
Expand All @@ -97,7 +97,7 @@ public boolean archive(final List<BlobSidecar> blobSidecars) {
indexWriter.newLine();
return true;
} catch (IOException | NullPointerException e) {
LOG.warn("Failed to write BlobSidecar.", e);
LOG.error("Failed to write BlobSidecar.", e);
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -932,13 +932,13 @@ private boolean pruneBlobSidecars(

// Just warn if we failed to find all the BlobSidecars.
if (keys.size() != blobSidecars.size()) {
LOG.warn("Failed to retrieve BlobSidecars for keys:{}", keys);
LOG.warn("Failed to retrieve BlobSidecars for keys: {}", keys);
}

// Attempt to archive the BlobSidecars.
final boolean blobSidecarArchived = archiveWriter.archive(blobSidecars);
if (!blobSidecarArchived) {
LOG.warn("Failed to archive and prune BlobSidecars. Stopping pruning");
LOG.error("Failed to archive and prune BlobSidecars. Stopping pruning");
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ private void pruneBlobsPriorToAvailabilityWindow() {
nonCanonicalBlobsPruningStart,
nonCanonicalBlobsLimitReached);
}
} catch (ShuttingDownException | RejectedExecutionException | IOException ex) {
} catch (IOException ex) {
LOG.error("Failed to get the BlobSidecar archive writer", ex);
} catch (ShuttingDownException | RejectedExecutionException ex) {
LOG.debug("Shutting down", ex);
}
}
Expand Down

0 comments on commit 7fbf16a

Please sign in to comment.