Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rrd4j] Error handling for broken rrd4j files #13955

Merged
merged 2 commits into from
Dec 15, 2022
Merged
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 @@ -152,7 +152,12 @@ public synchronized void store(final Item item, @Nullable final String alias) {
}
final String name = alias == null ? item.getName() : alias;

RrdDb db = getDB(name);
RrdDb db = null;
try {
db = getDB(name);
} catch (Exception e) {
logger.warn("Failed to open rrd4j database '{}' ({})", name, e.getClass().getName());
holgerfriedrich marked this conversation as resolved.
Show resolved Hide resolved
}
if (db == null) {
return;
}
Expand Down Expand Up @@ -249,7 +254,13 @@ public void store(Item item) {
public Iterable<HistoricItem> query(FilterCriteria filter) {
String itemName = filter.getItemName();

RrdDb db = getDB(itemName);
RrdDb db = null;
try {
db = getDB(itemName);
} catch (Exception e) {
logger.warn("Failed to open rrd4j database '{}' ({})", itemName, e.getClass().getName());
holgerfriedrich marked this conversation as resolved.
Show resolved Hide resolved
return List.of();
}
if (db == null) {
logger.debug("Could not find item '{}' in rrd4j database", itemName);
return List.of();
Expand Down