Skip to content

Commit

Permalink
[fix](fe ut) Fix borrow oject throw npe (apache#27072) (apache#27207)
Browse files Browse the repository at this point in the history
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)
```
  • Loading branch information
deardeng authored and gnehil committed Dec 4, 2023
1 parent 9d5e62e commit f0ed992
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,12 @@ public void run() {
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);
Expand Down

0 comments on commit f0ed992

Please sign in to comment.