Skip to content

Commit

Permalink
Merge branch 'fix-request-cache' into '2.7.7-ctrip'
Browse files Browse the repository at this point in the history
[master] DefaultFuture turn off logging optimization for Channel(issue apache#8695) (apache#8778)

See merge request framework/dubbo!52
  • Loading branch information
Yuyang Gong (龚昱阳) committed Sep 16, 2021
2 parents f05b5d9 + 846c200 commit 9f64e17
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dubbo-dependencies-bom/pom.xml
Expand Up @@ -163,7 +163,7 @@
<mortbay_jetty_version>6.1.26</mortbay_jetty_version>
<portlet_version>2.0</portlet_version>
<maven_flatten_version>1.1.0</maven_flatten_version>
<revision>2.7.7-ctrip.10</revision>
<revision>2.7.7-ctrip.11</revision>
</properties>

<distributionManagement>
Expand Down
2 changes: 1 addition & 1 deletion dubbo-dependencies/dubbo-dependencies-zookeeper/pom.xml
Expand Up @@ -32,7 +32,7 @@
<packaging>pom</packaging>

<properties>
<revision>2.7.7-ctrip.10</revision>
<revision>2.7.7-ctrip.11</revision>
<maven_flatten_version>1.1.0</maven_flatten_version>
</properties>
<distributionManagement>
Expand Down
Expand Up @@ -127,6 +127,25 @@ public void setHeartbeat(boolean isHeartbeat) {
}
}

public Request copy() {
Request copy = new Request(mId);
copy.mVersion = this.mVersion;
copy.mTwoWay = this.mTwoWay;
copy.mEvent = this.mEvent;
copy.mBroken = this.mBroken;
copy.mData = this.mData;
return copy;
}

public Request copyWithoutData() {
Request copy = new Request(mId);
copy.mVersion = this.mVersion;
copy.mTwoWay = this.mTwoWay;
copy.mEvent = this.mEvent;
copy.mBroken = this.mBroken;
return copy;
}

@Override
public String toString() {
return "Request [id=" + mId + ", version=" + mVersion + ", twoway=" + mTwoWay + ", event=" + mEvent
Expand Down
Expand Up @@ -152,7 +152,7 @@ public static void closeChannel(Channel channel) {
disconnectResponse.setErrorMessage("Channel " +
channel +
" is inactive. Directly return the unFinished request : " +
future.getRequest());
(logger.isDebugEnabled() ? future.getRequest() : future.getRequest().copyWithoutData()));
DefaultFuture.received(channel, disconnectResponse);
}
}
Expand Down Expand Up @@ -256,15 +256,10 @@ private String getTimeoutMessage(boolean scan) {
+ (sent > 0 ? " client elapsed: " + (sent - start)
+ " ms, server elapsed: " + (nowTimestamp - sent)
: " elapsed: " + (nowTimestamp - start)) + " ms, timeout: "
+ timeout + " ms, request: " + (logger.isDebugEnabled() ? request : getRequestWithoutData()) + ", channel: " + channel.getLocalAddress()
+ timeout + " ms, request: " + (logger.isDebugEnabled() ? request : request.copyWithoutData()) + ", channel: " + channel.getLocalAddress()
+ " -> " + channel.getRemoteAddress();
}

private Request getRequestWithoutData() {
Request newRequest = request;
newRequest.setData(null);
return newRequest;
}

private static class TimeoutCheckTask implements TimerTask {

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -126,7 +126,7 @@
<arguments />
<checkstyle.skip>true</checkstyle.skip>
<rat.skip>true</rat.skip>
<revision>2.7.7-ctrip.10</revision>
<revision>2.7.7-ctrip.11</revision>
</properties>
<distributionManagement>
<snapshotRepository>
Expand Down

0 comments on commit 9f64e17

Please sign in to comment.