Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[thin-client] Added debug logging for thin client single-get #1524

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ ext.libraries = [
commonsLang: 'commons-lang:commons-lang:2.6',
conscrypt: 'org.conscrypt:conscrypt-openjdk-uber:2.5.2',
d2: "com.linkedin.pegasus:d2:${pegasusVersion}",
duckdbJdbc: "org.duckdb:duckdb_jdbc:1.2.0-20250124.011319-133", // TODO: Remove SNAPSHOT when the real release is published!
duckdbJdbc: "org.duckdb:duckdb_jdbc:1.2.0",
failsafe: 'net.jodah:failsafe:2.4.0',
fastUtil: 'it.unimi.dsi:fastutil:8.3.0',
grpcNettyShaded: "io.grpc:grpc-netty-shaded:${grpcVersion}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,18 +366,24 @@ public CompletableFuture<V> get(K key, Optional<ClientStats> stats, long preRequ
() -> transportClient.get(requestPath, RequestHeadersProvider.getThinClientGetHeaderMap()),
(response, throwable, responseCompleteReporter) -> {
try {
LOGGER.debug("Received response for store {}", getStoreName());
if (throwable != null) {
LOGGER.error("Error response for store {}", getStoreName(), throwable);
valueFuture.completeExceptionally(throwable);
} else if (response == null) {
LOGGER.debug("null response for store {}", getStoreName());
// Doesn't exist
valueFuture.complete(null);
} else if (!response.isSchemaIdValid()) {
LOGGER.error("Invalid schema id for store {}", getStoreName());
valueFuture.completeExceptionally(
new VeniceClientException("No valid schema id received for single-get request!"));
} else {
LOGGER.debug("Valid response for store {}", getStoreName());
CompressionStrategy compressionStrategy = response.getCompressionStrategy();
long decompressionStartTime = System.nanoTime();
ByteBuffer data = decompressRecord(compressionStrategy, ByteBuffer.wrap(response.getBody()));
LOGGER.debug("Decompressed response for store {}", getStoreName());
stats.ifPresent(
(clientStats) -> clientStats
.recordResponseDecompressionTime(LatencyUtils.getElapsedTimeFromNSToMS(decompressionStartTime)));
Expand All @@ -386,6 +392,7 @@ public CompletableFuture<V> get(K key, Optional<ClientStats> stats, long preRequ
responseCompleteReporter.report();
}
} catch (Exception e) {
LOGGER.error("Caught exception while handling response", e);
// Defensive code
if (!valueFuture.isDone()) {
valueFuture.completeExceptionally(e);
Expand Down Expand Up @@ -519,6 +526,7 @@ private <R> CompletableFuture<R> requestSubmissionWithStatsHandling(
Supplier<CompletableFuture<TransportClientResponse>> requestSubmitter,
ResponseHandler<R> responseHandler) throws VeniceClientException {
final long preSubmitTimeInNS = System.nanoTime();
LOGGER.debug("Sending request for store {}", getStoreName());
CompletableFuture<TransportClientResponse> transportFuture = requestSubmitter.get();

BiFunction<TransportClientResponse, Throwable, R> responseHandlerWithStats = (clientResponse, throwable) -> {
Expand Down
Loading