Skip to content
This repository was archived by the owner on Jul 22, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
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 @@ -25,10 +25,10 @@
import com.linkedin.d2.discovery.stores.PropertyStore;
import com.linkedin.d2.discovery.util.Stats;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -139,19 +139,7 @@ public T get(String listenTo)
{
try
{
byte content[] = new byte[(int) file.length()];
int offset = 0;
int read = 0;
int length = (int) file.length();
FileInputStream inputStream = new FileInputStream(file);

while ((read = inputStream.read(content, offset, length - offset)) > 0)
{
offset += read;
}

inputStream.close();

byte[] content = Files.readAllBytes(file.toPath());
return _serializer.fromBytes(content);
}
catch (IOException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ public void startPublishing(String prop)
// Publish null value to avoid hanging waiters; Listener interface does not contemplate errors
_eventBus.publishInitialize(prop, null);
}
catch (RuntimeException e)
{
LOG.error("Unexpected error getting property " + prop + " from underlying store", e);
_eventBus.publishInitialize(prop, null);
}
}

@Override
Expand Down
Loading