nastra commented on code in PR #16695:
URL: https://github.com/apache/iceberg/pull/16695#discussion_r3390002707


##########
core/src/main/java/org/apache/iceberg/rest/RESTMetricsReporter.java:
##########
@@ -57,21 +57,18 @@ public void report(MetricsReport report) {
       return;
     }
 
-    Tasks.range(1)
-        .executeWith(METRICS_EXECUTOR)
-        .suppressFailureWhenFinished()
-        .onFailure(
-            (item, exception) ->
-                LOG.warn(
-                    "Failed to report metrics to REST endpoint {}", 
metricsEndpoint, exception))
-        .run(
-            item -> {
-              client.post(
-                  metricsEndpoint,
-                  ReportMetricsRequest.of(report),
-                  null,
-                  headers,
-                  ErrorHandlers.defaultErrorHandler());
-            });
+    executor.execute(

Review Comment:
   something like this:
   ```
   try {
       executor.execute(
           () -> {
             try {
               ...
             } catch (Exception e) {
               LOG.warn("Failed to report metrics to REST endpoint {}", 
metricsEndpoint, e);
             }
           });
     } catch (RejectedExecutionException e) {
       LOG.warn("Failed to report metrics to REST endpoint {} because metrics 
executor has been shut down", metricsEndpoint, e);
     }
   ```



-- 
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