Skip to content

Commit 13316ec

Browse files
committed
address pr feedback and revert ipv4 changes
1 parent 478c6ba commit 13316ec

4 files changed

Lines changed: 9 additions & 16 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/OpenTelemetryJulHandler.java

Lines changed: 4 additions & 8 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,10 +79,8 @@ public void publish(LogRecord record) {
7879
publishToOTel(record, connectionId, config.openTelemetry);
7980
}
8081
} catch (Throwable t) {
81-
reportError(
82-
"Error publishing log to OpenTelemetry/GCP",
83-
new Exception(t),
84-
java.util.logging.ErrorManager.WRITE_FAILURE);
82+
Exception ex = (t instanceof Exception) ? (Exception) t : new Exception(t);
83+
reportError("Error publishing log to OpenTelemetry/GCP", ex, ErrorManager.WRITE_FAILURE);
8584
}
8685
}
8786

@@ -185,10 +184,7 @@ public void flush() {
185184
try {
186185
config.loggingClient.flush();
187186
} catch (Exception e) {
188-
reportError(
189-
"Error flushing log to OpenTelemetry/GCP",
190-
e,
191-
java.util.logging.ErrorManager.FLUSH_FAILURE);
187+
reportError("Error flushing log to OpenTelemetry/GCP", e, ErrorManager.FLUSH_FAILURE);
192188
}
193189
}
194190
}

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

Lines changed: 2 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,7 @@ 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-
if (h instanceof java.util.logging.FileHandler
2812-
|| h.getClass().getName().endsWith("PerConnectionFileHandler")) {
2812+
if (!(h instanceof OpenTelemetryJulHandler)) {
28132813
h.close();
28142814
bqLogger.removeHandler(h);
28152815
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ private Trace verifyAndFetchTrace(String traceId) throws Exception {
307307

308308
private <T> T pollWithRetry(java.util.concurrent.Callable<T> task) throws InterruptedException {
309309
int attempts = 0;
310-
int maxAttempts = 24;
310+
int maxAttempts = 10;
311311
long delayMs = 10000;
312312

313313
// 10 second wait for GCP to ingest data

0 commit comments

Comments
 (0)