[fix](fe ut) Fix borrow oject throw npe (#27072)
occasional failure of fe ut, borrowObject throw npe ``` get agent task request. type: CREATE, signature: 10008, fe addr: null java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) at org.apache.commons.pool2.impl.GenericKeyedObjectPool.register(GenericKeyedObjectPool.java:1079) at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:347) get agent task request. type: CREATE, signature: 10012, fe addr: TNetworkAddress(hostname:127.0.0.1, port:56072) at org.apache.commons.pool2.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:277) at org.apache.doris.common.GenericPool.borrowObject(GenericPool.java:99) at org.apache.doris.utframe.MockedBackendFactory$DefaultBeThriftServiceImpl$1.run(MockedBackendFactory.java:219) at java.lang.Thread.run(Thread.java:750) ```
This commit is contained in:
@ -174,8 +174,12 @@ public class MockedBackendFactory {
|
||||
FrontendService.Client client = null;
|
||||
TNetworkAddress address = null;
|
||||
try {
|
||||
address = backend.getFeAddress();
|
||||
// ATTR: backend.getFeAddress must after taskQueue.take, because fe addr thread race
|
||||
TAgentTaskRequest request = taskQueue.take();
|
||||
address = backend.getFeAddress();
|
||||
if (address == null) {
|
||||
System.out.println("fe addr thread race, please check it");
|
||||
}
|
||||
System.out.println(
|
||||
"get agent task request. type: " + request.getTaskType() + ", signature: "
|
||||
+ request.getSignature() + ", fe addr: " + address);
|
||||
|
||||
Reference in New Issue
Block a user