Skip to content

Commit f2e5ebd

Browse files
authored
Merge branch 'main' into grpc-1.83.0
2 parents 4cebbd7 + b245b5d commit f2e5ebd

6 files changed

Lines changed: 15 additions & 12 deletions

File tree

java-bigquery-jdbc/pom.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
<github.global.server>github</github.global.server>
3333
<site.installationModule>google-cloud-bigquery-jdbc</site.installationModule>
3434
<skipShade>false</skipShade>
35-
<preferIpv4.test.argLine>-Djava.net.preferIPv4Stack=true</preferIpv4.test.argLine>
3635
</properties>
3736

3837
<build>
@@ -48,7 +47,6 @@
4847
<artifactId>maven-surefire-plugin</artifactId>
4948
<version>3.5.2</version>
5049
<configuration>
51-
<argLine>@{argLine} ${preferIpv4.test.argLine}</argLine>
5250
<skip>${skipSurefire}</skip>
5351
<systemPropertyVariables>
5452
<JDBC_TESTS>true</JDBC_TESTS>
@@ -59,7 +57,6 @@
5957
<groupId>org.apache.maven.plugins</groupId>
6058
<artifactId>maven-failsafe-plugin</artifactId>
6159
<configuration>
62-
<argLine>@{argLine} ${preferIpv4.test.argLine}</argLine>
6360
<systemPropertyVariables>
6461
<JDBC_TESTS>true</JDBC_TESTS>
6562
</systemPropertyVariables>
@@ -480,14 +477,14 @@
480477
<groupId>org.apache.maven.plugins</groupId>
481478
<artifactId>maven-surefire-plugin</artifactId>
482479
<configuration>
483-
<argLine>@{argLine} ${preferIpv4.test.argLine} --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
480+
<argLine>--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
484481
</configuration>
485482
</plugin>
486483
<plugin>
487484
<groupId>org.apache.maven.plugins</groupId>
488485
<artifactId>maven-failsafe-plugin</artifactId>
489486
<configuration>
490-
<argLine>@{argLine} ${preferIpv4.test.argLine} --add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
487+
<argLine>--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine>
491488
</configuration>
492489
</plugin>
493490
</plugins>

java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryConnection.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,6 +1185,7 @@ void removeStatement(Statement statement) {
11851185
}
11861186

11871187
private OpenTelemetry getOpenTelemetryInstance() {
1188+
BigQueryJdbcOpenTelemetry.ensureGlobalHandlerAttached();
11881189

11891190
String effectiveProjectId =
11901191
(this.gcpTelemetryProjectId != null) ? this.gcpTelemetryProjectId : this.catalog;

java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/OpenTelemetryJulHandler.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import io.opentelemetry.context.Context;
3131
import java.time.Instant;
3232
import java.util.Collections;
33+
import java.util.logging.ErrorManager;
3334
import java.util.logging.Handler;
3435
import java.util.logging.Level;
3536
import java.util.logging.LogRecord;
@@ -78,7 +79,8 @@ public void publish(LogRecord record) {
7879
publishToOTel(record, connectionId, config.openTelemetry);
7980
}
8081
} catch (Throwable t) {
81-
// Ignore exceptions to prevent breaking application logging or other handlers
82+
Exception ex = (t instanceof Exception) ? (Exception) t : new Exception(t);
83+
reportError("Error publishing log to OpenTelemetry/GCP", ex, ErrorManager.WRITE_FAILURE);
8284
}
8385
}
8486

@@ -182,7 +184,7 @@ public void flush() {
182184
try {
183185
config.loggingClient.flush();
184186
} catch (Exception e) {
185-
// Ignore failures during flush to protect other connections
187+
reportError("Error flushing log to OpenTelemetry/GCP", e, ErrorManager.FLUSH_FAILURE);
186188
}
187189
}
188190
}

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import com.google.cloud.bigquery.jdbc.BigQueryConnection;
3737
import com.google.cloud.bigquery.jdbc.BigQueryDriver;
3838
import com.google.cloud.bigquery.jdbc.DataSource;
39+
import com.google.cloud.bigquery.jdbc.OpenTelemetryJulHandler;
3940
import com.google.common.collect.ImmutableMap;
4041
import java.io.File;
4142
import java.io.IOException;
@@ -2808,8 +2809,10 @@ public void testPerConnectionLoggingE2E() throws SQLException, IOException {
28082809
java.util.logging.Logger bqLogger =
28092810
java.util.logging.Logger.getLogger("com.google.cloud.bigquery");
28102811
for (java.util.logging.Handler h : bqLogger.getHandlers()) {
2811-
h.close();
2812-
bqLogger.removeHandler(h);
2812+
if (!(h instanceof OpenTelemetryJulHandler)) {
2813+
h.close();
2814+
bqLogger.removeHandler(h);
2815+
}
28132816
}
28142817

28152818
// Verify physical connection-specific log file creation

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITOpenTelemetryTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@
4545
import java.sql.Statement;
4646
import java.util.ArrayList;
4747
import java.util.List;
48-
import org.junit.jupiter.api.Tag;
4948
import org.junit.jupiter.api.Test;
5049

51-
@Tag("known_issue") // b/539615312
5250
public class ITOpenTelemetryTest extends ITBase {
5351

5452
private static final String PROJECT_ID = ServiceOptions.getDefaultProjectId();
@@ -309,7 +307,7 @@ private Trace verifyAndFetchTrace(String traceId) throws Exception {
309307

310308
private <T> T pollWithRetry(java.util.concurrent.Callable<T> task) throws InterruptedException {
311309
int attempts = 0;
312-
int maxAttempts = 24;
310+
int maxAttempts = 10;
313311
long delayMs = 10000;
314312

315313
// 10 second wait for GCP to ingest data

java-pubsub/google-cloud-pubsub/src/test/java/com/google/cloud/pubsub/v1/StreamingSubscriberConnectionTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import java.util.concurrent.atomic.AtomicInteger;
5656
import org.junit.After;
5757
import org.junit.Before;
58+
import org.junit.Ignore;
5859
import org.junit.Rule;
5960
import org.junit.Test;
6061
import org.junit.rules.TestName;
@@ -547,6 +548,7 @@ public void testSendAckOperationsExactlyOnceEnabledMessageFuturesAcks() {
547548
}
548549
}
549550

551+
@Ignore("https://github.com/googleapis/google-cloud-java/issues/13706")
550552
@Test
551553
public void testSendAckOperationsExactlyOnceEnabledErrorWithEmptyMetadataMap() {
552554
// Setup

0 commit comments

Comments
 (0)