rajarshisarkar commented on code in PR #4500:
URL: https://github.com/apache/iceberg/pull/4500#discussion_r842499323


##########
aws/src/main/java/org/apache/iceberg/aws/s3/S3FileIO.java:
##########
@@ -278,7 +278,8 @@ public void initialize(Map<String, String> properties) {
       this.metrics = ctor.newInstance("s3");
 
       metrics.initialize(properties);
-    } catch (NoSuchMethodException | ClassCastException e) {
+    } catch (NoClassDefFoundError | NoSuchMethodException | ClassCastException 
e) {
+      this.metrics = MetricsContext.nullMetrics();

Review Comment:
   I don't see any harm in initialising at a class level (might be helpful for 
some use cases, maybe a test?). I can be convinced otherwise though.
   
   The scenario here is - during runtime metrics is overridden at `this.metrics 
= ctor.newInstance("scheme");` and then the exception happens in 
`metrics.initialize(properties);` leading to no fallback.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to