Skip to content

Commit

Permalink
Handle concurrent table drop in TableCommentSystemTable
Browse files Browse the repository at this point in the history
  • Loading branch information
raunaqmorarka authored and sopel39 committed Jul 1, 2021
1 parent 600963c commit 922aac8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ private Optional<String> getComment(
return metadata.getRedirectionAwareTableHandle(session, tableName).getTableHandle()
.map(handle -> metadata.getTableMetadata(session, handle))
.map(metadata -> metadata.getMetadata().getComment())
.get();
.orElseGet(() -> {
// A previously listed table might have been dropped concurrently
LOG.debug("Failed to get metadata for table: %s", name);
return Optional.empty();
});
}
}

0 comments on commit 922aac8

Please sign in to comment.