-
Notifications
You must be signed in to change notification settings - Fork 12k
Description
BUG REPORT
- A error happend while send a message, the following request will be rejected by server and throw an exception:[REJECTREQUEST]system busy, start flow control for a while:
-
Set a domain which is dynamically generated for brokerIP1, and the domain doesn't parse successfully immediately.
-
The first few send requests failed due to domain parse error which result in a NullPointException when invoke method msgInner.getStoreHostBytes,then the following messages will be send successfully as the domain can parse successfully in the end.
-
The send request always failed although domain is normal. CommitLog's member variable beginTimeInLock which is always reset to zero after append a message to commit log successful doesn't reset to zero as the NullPointException, so SendMessageProcessor's rejectRequest() method always return true and the server think page cache is busy and reject all send request.
-
The environment is rocketmq:4.2, java:1.8.
-
My suggestion
- I think beginTimeInLock = 0 should stay with putMessageLock.unlock() in finally statement int CommitLog's putMessage() method then previous request's error will not affect subsequent.
- rewrite the method SendMessageProcessor.getStoreHost() like this:
public SocketAddress getStoreHost() { InetSocketAddress addr = (InetSocketAddress) storeHost; if (addr.getAddress() == null) { storeHost = new InetSocketAddress(brokerController.getBrokerConfig().getBrokerIP2(), brokerController.getNettyServerConfig().getListenPort()); log.warn("renew storeHost for parse hostName!"); } return storeHost; }