Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e798093
simplify if grammar
Dec 23, 2016
11fdce2
Merge remote-tracking branch 'upstream/master'
Dec 30, 2016
c28af1c
Merge remote-tracking branch 'upstream/master'
zhaozhanh Dec 31, 2016
9cb0a0c
[ROCKETMQ-5] Avoid creating directories in UtilAll#getDiskPartitionSp…
shroman Jan 3, 2017
d891d28
simplify if grammar
Dec 23, 2016
4e5044c
Merge branch 'master' of https://github.com/naughtybear/incubator-roc…
Jan 3, 2017
b421d48
Fix https://issues.apache.org/jira/browse/ROCKETMQ-25
lizhanhui Jan 4, 2017
920dd31
Fix hard-coded topic/subscription config file path.
lizhanhui Jan 4, 2017
23e6c7a
Fix checkstyle.
lizhanhui Jan 4, 2017
0c0b730
Fix integer overflow.
lizhanhui Jan 5, 2017
55d73e1
Fix release.xml to include files in sub-directories of conf
lizhanhui Jan 6, 2017
9d76ea9
MASTER [ROCKETMQ-33] Resolve cpu occupy 100% issue in GroupCommitServ…
Jan 9, 2017
85467df
Fix-35 [ROCKETMQ-35] Reslove underlying NPE in ConsumeRequest, closes…
qinliujie Jan 9, 2017
776911d
[ROCKETMQ-34] Potential NPE in NettyConnetManageHandler#connect, clos…
shroman Jan 9, 2017
f936057
[ROCKETMQ-31] Fix 'No such file or directory' warning for /Users/zhou…
iskl Jan 9, 2017
1562bd0
[ROCKETMQ-30] Fixed method signature for Message Filter example and c…
shroman Jan 9, 2017
6e31d86
[ROCKETMQ-22] Resolve ClassCastException issue in printWaterMark.
zhouxinyu Jan 9, 2017
6baa2ed
[ROCKETMQ-1] Update notice file.
zhouxinyu Jan 10, 2017
7fcf2f1
Add javadoc to DefaultMQProducer
lizhanhui Jan 11, 2017
de628a4
Add javadoc to DefaultMQProducer
lizhanhui Jan 11, 2017
f32e0b9
Add javadoc to DefaultMQPushConsumer
lizhanhui Jan 13, 2017
7037455
Update code style.
zhouxinyu Jan 13, 2017
75d337d
Set SPACE_AFTER_TYPE_CAST=true.
zhouxinyu Jan 13, 2017
a2248f9
simplify if grammar
Dec 23, 2016
0338f8b
Merge branch 'master' of https://github.com/naughtybear/incubator-roc…
Jan 16, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
RocketMQ
Copyright 2016 Alibaba Group.
Apache RocketMQ (incubating)
Copyright 2016 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).
2 changes: 0 additions & 2 deletions bin/mqbroker
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,4 @@ fi

export ROCKETMQ_HOME

rm -f $HOME/rmq_bk_gc.log.bac
cp $HOME/rmq_bk_gc.log $HOME/rmq_bk_gc.log.bac
sh ${ROCKETMQ_HOME}/bin/runbroker.sh org.apache.rocketmq.broker.BrokerStartup $@
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public long headSlowTimeMills(BlockingQueue<Runnable> q) {
final Runnable peek = q.peek();
if (peek != null) {
RequestTask rt = BrokerFastFailure.castRunnable(peek);
slowTimeMills = this.messageStore.now() - rt.getCreateTimestamp();
slowTimeMills = rt == null ? 0 : this.messageStore.now() - rt.getCreateTimestamp();
}

if (slowTimeMills < 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private void cleanExpiredRequest() {
} else {
break;
}
} catch (Throwable e) {
} catch (Throwable ignored) {
}
}

Expand Down Expand Up @@ -99,7 +99,7 @@ private void cleanExpiredRequest() {
} else {
break;
}
} catch (Throwable e) {
} catch (Throwable ignored) {
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public void notifyMessageArriving(final String topic, final int queueId, final l
if (newestOffset > request.getPullFromThisOffset()) {
if (this.messageFilter.isMessageMatched(request.getSubscriptionData(), tagsCode)) {
try {
this.brokerController.getPullMessageProcessor().excuteRequestWhenWakeup(request.getClientChannel(),
this.brokerController.getPullMessageProcessor().executeRequestWhenWakeup(request.getClientChannel(),
request.getRequestCommand());
} catch (Throwable e) {
log.error("execute request when wakeup failed.", e);
Expand All @@ -141,7 +141,7 @@ public void notifyMessageArriving(final String topic, final int queueId, final l

if (System.currentTimeMillis() >= (request.getSuspendTimestamp() + request.getTimeoutMillis())) {
try {
this.brokerController.getPullMessageProcessor().excuteRequestWhenWakeup(request.getClientChannel(),
this.brokerController.getPullMessageProcessor().executeRequestWhenWakeup(request.getClientChannel(),
request.getRequestCommand());
} catch (Throwable e) {
log.error("execute request when wakeup failed.", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.apache.rocketmq.remoting.common.RemotingUtil;
import org.apache.rocketmq.remoting.exception.RemotingCommandException;
import org.apache.rocketmq.remoting.netty.NettyRequestProcessor;
import org.apache.rocketmq.remoting.netty.RequestTask;
import org.apache.rocketmq.remoting.protocol.RemotingCommand;
import org.apache.rocketmq.store.GetMessageResult;
import org.apache.rocketmq.store.MessageExtBrokerInner;
Expand Down Expand Up @@ -481,7 +482,7 @@ private void generateOffsetMovedEvent(final OffsetMovedEvent event) {
}
}

public void excuteRequestWhenWakeup(final Channel channel, final RemotingCommand request) throws RemotingCommandException {
public void executeRequestWhenWakeup(final Channel channel, final RemotingCommand request) throws RemotingCommandException {
Runnable run = new Runnable() {
@Override
public void run() {
Expand Down Expand Up @@ -513,8 +514,7 @@ public void operationComplete(ChannelFuture future) throws Exception {
}
}
};

this.brokerController.getPullMessageExecutor().submit(run);
this.brokerController.getPullMessageExecutor().submit(new RequestTask(run, channel, request));
}

public void registerConsumeMessageHook(List<ConsumeMessageHook> sendMessageHookList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.rocketmq.broker.subscription;

import java.io.File;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
Expand Down Expand Up @@ -142,8 +141,8 @@ public String encode() {

@Override
public String configFilePath() {
//return BrokerPathConfigHelper.getSubscriptionGroupPath(this.brokerController.getMessageStoreConfig().getStorePathRootDir());
return BrokerPathConfigHelper.getSubscriptionGroupPath(System.getProperty("user.home") + File.separator + "store");
return BrokerPathConfigHelper.getSubscriptionGroupPath(this.brokerController.getMessageStoreConfig()
.getStorePathRootDir());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.rocketmq.broker.topic;

import java.io.File;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
Expand Down Expand Up @@ -381,9 +380,8 @@ public String encode() {

@Override
public String configFilePath() {
// return BrokerPathConfigHelper.getTopicConfigPath(this.brokerController.getMessageStoreConfig()
// .getStorePathRootDir());
return BrokerPathConfigHelper.getTopicConfigPath(System.getProperty("user.home") + File.separator + "store");
return BrokerPathConfigHelper.getTopicConfigPath(this.brokerController.getMessageStoreConfig()
.getStorePathRootDir());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.rocketmq.broker.api;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import org.apache.rocketmq.broker.BrokerTestHarness;
import org.apache.rocketmq.broker.latency.BrokerFastFailure;
import org.apache.rocketmq.broker.latency.FutureTaskExt;
import org.apache.rocketmq.remoting.netty.RequestTask;
import org.junit.Assert;
import org.junit.Test;

public class BrokerFastFailureTest extends BrokerTestHarness {

@Test
public void testHeadSlowTimeMills() throws InterruptedException {
BlockingQueue<Runnable> blockingQueue = new LinkedBlockingQueue<>();
blockingQueue.add(new FutureTaskExt<>(new RequestTask(null, null, null), null));
TimeUnit.MILLISECONDS.sleep(10);
Assert.assertTrue(this.brokerController.headSlowTimeMills(blockingQueue) > 0);

blockingQueue.clear();
blockingQueue.add(new Runnable() {
@Override public void run() {

}
});
Assert.assertTrue(this.brokerController.headSlowTimeMills(blockingQueue) == 0);
}

@Test
public void testCastRunnable() {
Runnable runnable = new Runnable() {
@Override public void run() {

}
};
Assert.assertNull(BrokerFastFailure.castRunnable(runnable));

RequestTask requestTask = new RequestTask(null, null, null);
runnable = new FutureTaskExt<>(requestTask, null);

Assert.assertEquals(requestTask, BrokerFastFailure.castRunnable(runnable));
}
}
Loading