Apache9 commented on PR #7604:
URL: https://github.com/apache/hbase/pull/7604#issuecomment-3729179157

   > I think it's the test Rule that managed the global instance. Are parallel 
test executions stepping on each other's static state?
   
   ```
     static RequestHeader buildRequestHeader(Call call, CellBlockMeta 
cellBlockMeta) {
       RequestHeader.Builder builder = RequestHeader.newBuilder();
       builder.setCallId(call.id);
       RPCTInfo.Builder traceBuilder = RPCTInfo.newBuilder();
       
GlobalOpenTelemetry.getPropagators().getTextMapPropagator().inject(Context.current(),
         traceBuilder, (carrier, key, value) -> carrier.putHeaders(key, value));
       builder.setTraceInfo(traceBuilder.build());
       builder.setMethodName(call.md.getName());
       builder.setRequestParam(call.param != null);
       if (cellBlockMeta != null) {
         builder.setCellBlockMeta(cellBlockMeta);
       }
       // Only pass priority if there is one set.
       if (call.priority != HConstants.PRIORITY_UNSET) {
         builder.setPriority(call.priority);
       }
       if (call.attributes != null && !call.attributes.isEmpty()) {
         HBaseProtos.NameBytesPair.Builder attributeBuilder = 
HBaseProtos.NameBytesPair.newBuilder();
         for (Map.Entry<String, byte[]> attribute : call.attributes.entrySet()) 
{
           attributeBuilder.setName(attribute.getKey());
           
attributeBuilder.setValue(UnsafeByteOperations.unsafeWrap(attribute.getValue()));
           builder.addAttribute(attributeBuilder.build());
         }
       }
       builder.setTimeout(call.timeout);
   
       return builder.build();
     }
   ```
   
   GlobalOpenTelemetry.getPropagators() may lead to a GlobalOpenTelemetry.set 
call, see the above stacktrace
   
   ```
   Caused by: java.lang.Throwable
        at 
io.opentelemetry.api.GlobalOpenTelemetry.set(GlobalOpenTelemetry.java:115)
        at 
io.opentelemetry.api.GlobalOpenTelemetry.get(GlobalOpenTelemetry.java:85)
        at 
io.opentelemetry.api.GlobalOpenTelemetry.getPropagators(GlobalOpenTelemetry.java:217)
        at 
org.apache.hadoop.hbase.ipc.IPCUtil.buildRequestHeader(IPCUtil.java:124)
   ```
   
   There could be other threads which are still running after a test is marked 
as finished, these threads may have race with the main test thread. I guess 
this is the problem?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to