Skip to content

Commit 90dfd6b

Browse files
authored
[client] add exception logging for client request errors (linkedin#1887)
1 parent 8beceda commit 90dfd6b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

clients/venice-thin-client/src/main/java/com/linkedin/venice/client/store/StatTrackingStoreClient.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import com.linkedin.venice.stats.ClientType;
1818
import com.linkedin.venice.stats.TehutiUtils;
1919
import com.linkedin.venice.utils.LatencyUtils;
20+
import com.linkedin.venice.utils.RedundantExceptionFilter;
2021
import com.linkedin.venice.utils.concurrent.VeniceConcurrentHashMap;
2122
import io.tehuti.metrics.MetricsRepository;
2223
import java.util.Map;
@@ -38,6 +39,7 @@
3839
*/
3940
public class StatTrackingStoreClient<K, V> extends DelegatingStoreClient<K, V> {
4041
private static final Logger LOGGER = LogManager.getLogger(StatTrackingStoreClient.class);
42+
private static final RedundantExceptionFilter EXCEPTION_FILTER = new RedundantExceptionFilter();
4143

4244
private static final String STAT_VENICE_CLIENT_NAME = "venice_client";
4345
private static final String STAT_SCHEMA_READER = "schema_reader";
@@ -246,6 +248,7 @@ public void compute(
246248

247249
private static void handleUnhealthyRequest(ClientStats clientStats, Throwable throwable, double latency) {
248250
int httpStatus = getUnhealthyRequestHttpStatus(throwable);
251+
logException(clientStats.getName(), throwable);
249252
clientStats.emitUnhealthyRequestMetrics(latency, httpStatus);
250253
if (throwable instanceof VeniceClientHttpException) {
251254
clientStats.recordHttpRequest(httpStatus);
@@ -268,6 +271,12 @@ private static void handleMetricTrackingForStreamingCallback(
268271
clientStats.recordSuccessDuplicateRequestKeyCount(duplicateEntryCnt);
269272
}
270273

274+
private static void logException(String storeName, Throwable throwable) {
275+
if (!EXCEPTION_FILTER.isRedundantException(storeName, throwable)) {
276+
LOGGER.error("Unhealthy request with error: ", throwable);
277+
}
278+
}
279+
271280
@Override
272281
public ComputeRequestBuilder<K> compute() throws VeniceClientException {
273282
/**

0 commit comments

Comments
 (0)