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

Dubbo throws exception when use java serializer #4612

Closed
qixiaobo opened this issue Jul 20, 2019 · 3 comments
Closed

Dubbo throws exception when use java serializer #4612

qixiaobo opened this issue Jul 20, 2019 · 3 comments

Comments

@qixiaobo
Copy link
Contributor

The same problem like 2.6.x.
issues:
#3951
#3698

related-pr:
#2656

Since we have no reason make the method first line before decode!

We can see code from @liangfei0201 below

 // decode request.
            Request req = new Request(id);
            req.setVersion("2.0.0");
            req.setTwoWay((flag & FLAG_TWOWAY) != 0);
            if ((flag & FLAG_EVENT) != 0) {
                req.setEvent(Request.HEARTBEAT_EVENT);
            }
            try {
                Object data;
                if (req.isHeartbeat()) {
                    data = decodeHeartbeatData(channel, deserialize(s, channel.getUrl(), is));
                } else if (req.isEvent()) {
                    data = decodeEventData(channel, deserialize(s, channel.getUrl(), is));
                } else {
                    DecodeableRpcInvocation inv;
                    if (channel.getUrl().getParameter(
                        Constants.DECODE_IN_IO_THREAD_KEY,
                        Constants.DEFAULT_DECODE_IN_IO_THREAD)) {
                        inv = new DecodeableRpcInvocation(channel, req, is, proto);
                        inv.decode();
                    } else {
                        inv = new DecodeableRpcInvocation(channel, req,
                                                          new UnsafeByteArrayInputStream(readMessageData(is)), proto);
                    }
                    data = inv;
                }
                req.setData(data);
            } catch (Throwable t) {
                if (log.isWarnEnabled()) {
                    log.warn("Decode request failed: " + t.getMessage(), t);
                }
                // bad request
                req.setBroken(true);
                req.setData(t);
            }
            return req;

This code works well for java serializer.
We can see no call for method deserialize before DecodeableRpcInvocation.
#4530

@chickenlj
Copy link
Contributor

fixed by #4530

@chickenlj
Copy link
Contributor

Has been released at 2.6.7

@qixiaobo
Copy link
Contributor Author

Has been released at 2.6.7

You should say 2.6.x, maybe I think 2.6.8 will

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants