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

[Bug] dubbo2.7.7 output info when docode lose #15088

Open
3 of 4 tasks
nulinuli-nuli opened this issue Jan 22, 2025 · 1 comment
Open
3 of 4 tasks

[Bug] dubbo2.7.7 output info when docode lose #15088

nulinuli-nuli opened this issue Jan 22, 2025 · 1 comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@nulinuli-nuli
Copy link

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

Dubbo: 2.7.7
Java: 1.8

i want use MonitorFilter,but i found not have output.

output set in here
private void logMessageLength(Object result, int bytes) {
if (bytes > 0) {
if (result instanceof Request) {
try {
((RpcInvocation)((Request)result).getData()).setAttachment("input", String.valueOf(bytes));
} catch (Throwable var5) {
}
} else if (result instanceof Response) {
try {
((AppResponse)((Response)result).getResult()).setAttachment("output", String.valueOf(bytes));
} catch (Throwable var4) {
}
}

}

}

but when after this, output is lose
private void decode(Object message) {
if (message instanceof Decodeable) {
try {
((Decodeable)message).decode();
if (log.isDebugEnabled()) {
log.debug("Decode decodeable message " + message.getClass().getName());
}
} catch (Throwable var3) {
Throwable e = var3;
if (log.isWarnEnabled()) {
log.warn("Call Decodeable.decode failed: " + e.getMessage(), e);
}
}
}

}

Steps to reproduce this issue

use dubbo 2.7.7 then debug can reproduce ,very easy

What you expected to happen

i cat hava output in this code
private URL createStatisticsUrl(Invoker<?> invoker, Invocation invocation, Result result, String remoteHost, long start, boolean error) {
// ---- service statistics ----
long elapsed = System.currentTimeMillis() - start; // invocation cost
int concurrent = getConcurrent(invoker, invocation).get(); // current concurrent count
String application = invoker.getUrl().getParameter(APPLICATION_KEY);
String service = invoker.getInterface().getName(); // service name
String method = RpcUtils.getMethodName(invocation); // method name
String group = invoker.getUrl().getParameter(GROUP_KEY);
String version = invoker.getUrl().getParameter(VERSION_KEY);

    int localPort;
    String remoteKey, remoteValue;
    if (CONSUMER_SIDE.equals(invoker.getUrl().getParameter(SIDE_KEY))) {
        // ---- for service consumer ----
        localPort = 0;
        remoteKey = MonitorService.PROVIDER;
        remoteValue = invoker.getUrl().getAddress();
    } else {
        // ---- for service provider ----
        localPort = invoker.getUrl().getPort();
        remoteKey = MonitorService.CONSUMER;
        remoteValue = remoteHost;
    }
    String input = "", output = "";
    if (invocation.getAttachment(INPUT_KEY) != null) {
        input = invocation.getAttachment(INPUT_KEY);
    }
    if (result != null && result.getAttachment(OUTPUT_KEY) != null) {
        output = result.getAttachment(OUTPUT_KEY);
    }

    return new URL(COUNT_PROTOCOL, NetUtils.getLocalHost(), localPort, service + PATH_SEPARATOR + method, MonitorService.APPLICATION, application, MonitorService.INTERFACE, service, MonitorService.METHOD, method, remoteKey, remoteValue, error ? MonitorService.FAILURE : MonitorService.SUCCESS, "1", MonitorService.ELAPSED, String.valueOf(elapsed), MonitorService.CONCURRENT, String.valueOf(concurrent), INPUT_KEY, input, OUTPUT_KEY, output, GROUP_KEY, group, VERSION_KEY, version);
}

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@nulinuli-nuli nulinuli-nuli added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Jan 22, 2025
@wcy666103
Copy link
Contributor

This version has been archived, and no further code modifications or functional support will be provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage
Projects
Status: Todo
Development

No branches or pull requests

2 participants