Bug: Fix TestHTableTracing.testTableClose for nightly build of branch-2
Status: Resolved | Priority: Major | Resolution: Fixed
Created: 27/Sep/21 16:08
Affects Version/s: 2.5.0

after merging HBASE-26141, sometime isn't right with the last testTableClose when we close the table and the connection, need to figure out why it's not working in the unit test with the jdk8 and hadoop 3 profile

https://ci-hadoop.apache.org/job/HBase/job/HBase%20Nightly/job/branch-2/351/JDK8_20Nightly_20Build_20Report_20_28Hadoop3_29/
https://ci-hadoop.apache.org/job/HBase/job/HBase%20Nightly/job/branch-2/352/JDK8_20Nightly_20Build_20Report_20_28Hadoop3_29/

{code}
[ERROR] org.apache.hadoop.hbase.client.TestHTableTracing.testTableClose  Time elapsed: 0.001 s  <<< ERROR!
java.lang.IllegalStateException: GlobalOpenTelemetry.set has already been called. GlobalOpenTelemetry.set must be called only once before any calls to GlobalOpenTelemetry.get. If you are using the OpenTelemetrySdk, use OpenTelemetrySdkBuilder.buildAndRegisterGlobal instead. Previous invocation set to cause of this exception.
	at io.opentelemetry.api.GlobalOpenTelemetry.set(GlobalOpenTelemetry.java:83)
	at io.opentelemetry.sdk.testing.junit4.OpenTelemetryRule.before(OpenTelemetryRule.java:95)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:50)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.apache.hadoop.hbase.SystemExitRule$1.evaluate(SystemExitRule.java:38)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:288)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:282)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Throwable
	at io.opentelemetry.api.GlobalOpenTelemetry.set(GlobalOpenTelemetry.java:91)
	at io.opentelemetry.api.GlobalOpenTelemetry.get(GlobalOpenTelemetry.java:61)
	at io.opentelemetry.api.GlobalOpenTelemetry.getTracer(GlobalOpenTelemetry.java:110)
	at org.apache.hadoop.hbase.trace.TraceUtil.getGlobalTracer(TraceUtil.java:71)
	at org.apache.hadoop.hbase.trace.TraceUtil.createSpan(TraceUtil.java:95)
	at org.apache.hadoop.hbase.trace.TraceUtil.createSpan(TraceUtil.java:78)
	at org.apache.hadoop.hbase.trace.TraceUtil.lambda$trace$1(TraceUtil.java:176)
	at org.apache.hadoop.hbase.trace.TraceUtil.trace(TraceUtil.java:180)
	at org.apache.hadoop.hbase.trace.TraceUtil.trace(TraceUtil.java:176)
	at org.apache.hadoop.hbase.client.ConnectionImplementation.close(ConnectionImplementation.java:2110)
	at org.apache.hadoop.hbase.client.ConnectionImplementation.finalize(ConnectionImplementation.java:2149)
	at java.lang.System$2.invokeFinalize(System.java:1273)
	at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:102)
	at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:217)
{code}