Skip to content

Commit 37e6273

Browse files
committed
Fix ingestion-sink cross-project inserts
Update google cloud library to 1.61.0 to match beam 2.13.0 and pick up googleapis/google-cloud-java#4196 Emit stack traces in ingestion-sink
1 parent 7cbd98d commit 37e6273

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

ingestion-sink/src/main/java/com/mozilla/telemetry/ingestion/io/BigQuery.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ private synchronized Optional<CompletableFuture<TableRow>> add(TableRow row) {
137137
int index = newSize - 1;
138138
return Optional.of(result.thenApplyAsync(r -> {
139139
List<BigQueryError> errors = r.getErrorsFor(index);
140-
if (!errors.isEmpty()) {
140+
if (errors != null && !errors.isEmpty()) {
141141
throw new WriteErrors(errors);
142142
}
143143
return row;

ingestion-sink/src/main/java/com/mozilla/telemetry/ingestion/io/Pubsub.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.google.pubsub.v1.PubsubMessage;
1111
import java.util.concurrent.CompletableFuture;
1212
import java.util.function.Function;
13+
import java.util.logging.Logger;
1314

1415
public class Pubsub {
1516

@@ -18,6 +19,8 @@ private Pubsub() {
1819

1920
public static class Read {
2021

22+
static Logger logger = Logger.getLogger("Pubsub.Read");
23+
2124
@VisibleForTesting
2225
Subscriber subscriber;
2326

@@ -30,6 +33,7 @@ public Read(String subscriptionName, Function<PubsubMessage, CompletableFuture<?
3033
if (exception == null) {
3134
consumer.ack();
3235
} else {
36+
logger.warning("Exception while attempting to deliver message:", exception);
3337
consumer.nack();
3438
}
3539
})))

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<!-- Keep these dependency versions in sync with those pulled in by beam;
2929
check https://mvnrepository.com/artifact/org.apache.beam -->
30-
<google-cloud.version>1.49.0</google-cloud.version>
30+
<google-cloud.version>1.61.0</google-cloud.version>
3131
<jackson.version>2.9.9</jackson.version>
3232
</properties>
3333

0 commit comments

Comments
 (0)