Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.apache.dubbo.remoting.exchange.support.DefaultFuture doWithCloseChannel will logRequestData #8695

Closed
2 tasks done
vio-lin opened this issue Sep 6, 2021 · 1 comment · Fixed by #8775
Closed
2 tasks done
Labels
help wanted Everything needs help from contributors

Comments

@vio-lin
Copy link
Contributor

vio-lin commented Sep 6, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.14-SNAPSHOT
  • Operating System version: Win10
  • Java version: JDK8

Actual Result

打印出来的日志带有请求toString的内容

 public static void closeChannel(Channel channel) {
        for (Map.Entry<Long, Channel> entry : CHANNELS.entrySet()) {
            if (channel.equals(entry.getValue())) {
                DefaultFuture future = getFuture(entry.getKey());
                if (future != null && !future.isDone()) {
                    Response disconnectResponse = new Response(future.getId());
                    disconnectResponse.setStatus(Response.CHANNEL_INACTIVE);
                    disconnectResponse.setErrorMessage("Channel " +
                            channel +
                            " is inactive. Directly return the unFinished request : " +
                            // 这个方法会打印整个 request 对象toString的值
                            future.getRequest());
                    DefaultFuture.received(channel, disconnectResponse);
                }
            }
        }
    }

timeout打印的请求对象是不带有Request的

    private String getTimeoutMessage(boolean scan) {
        long nowTimestamp = System.currentTimeMillis();
        return (sent > 0 ? "Waiting server-side response timeout" : "Sending request timeout in client-side")
                + (scan ? " by scan timer" : "") + ". start time: "
                + (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date(start))) + ", end time: "
                + (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date(nowTimestamp))) + ","
                + (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()
                + " -> " + channel.getRemoteAddress();
    }

这个是漏加了吧

@AlbumenJ AlbumenJ added good first issue help wanted Everything needs help from contributors labels Sep 8, 2021
@wangchengming666
Copy link
Member

I'll fix it later.

vio-lin pushed a commit to vio-lin/incubator-dubbo that referenced this issue Feb 22, 2023
vio-lin pushed a commit to vio-lin/incubator-dubbo that referenced this issue Feb 22, 2023
[master] DefaultFuture turn off logging optimization for Channel(issue apache#8695) (apache#8778)

See merge request framework/dubbo!52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Everything needs help from contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants