robertwb commented on code in PR #34363: URL: https://github.com/apache/beam/pull/34363#discussion_r2006193249
########## runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowMetrics.java: ########## @@ -209,7 +209,14 @@ private BoundedTrieResult getBoundedTrieValue(MetricUpdate metricUpdate) { if (metricUpdate.getTrie() == null) { return BoundedTrieResult.empty(); } - BoundedTrie bTrie = (BoundedTrie) metricUpdate.getTrie(); + BoundedTrie bTrie; + try { + bTrie = (BoundedTrie) metricUpdate.getTrie(); + } catch (ClassCastException cce) { + LOG.warn( + "Failed to retrieve BoundedTrie metrics from result. Returning empty result.", cce); + return BoundedTrieResult.empty(); Review Comment: I'm not super comfortable with returning an incorrect result here due to a class cast exception... -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@beam.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org