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#closeChannel doesn't work as expected #4699

Closed
beiwei30 opened this issue Jul 30, 2019 · 0 comments
Assignees
Milestone

Comments

@beiwei30
Copy link
Member

org.apache.dubbo.remoting.exchange.support.DefaultFuture#closeChannel doesn't work as expected since the channel instances to be compared do not have correct equals() implementation:

 public static void closeChannel(Channel channel) {
        for (Map.Entry<Long, Channel> entry : CHANNELS.entrySet()) {
            if (channel.equals(entry.getValue())) { // in netty4, channel is NettyChannel, but entry.getValue() is NettyClient, equals will return false.
                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 : " +
                            future.getRequest());
                    DefaultFuture.received(channel, disconnectResponse);
                }
            }
        }
    }

This is the root cause of issue 1 in #1968.

@beiwei30 beiwei30 added this to the 2.7.4 milestone Jul 30, 2019
@beiwei30 beiwei30 self-assigned this Jul 30, 2019
cvictory pushed a commit that referenced this issue Sep 5, 2019
… closeChannel doesn't work as expected (#4700)

* issue #4699: org.apache.dubbo.remoting.exchange.support.DefaultFuture#closeChannel doesn't work as expected

* Revert "issue #4699: org.apache.dubbo.remoting.exchange.support.DefaultFuture#closeChannel doesn't work as expected"
@beiwei30 beiwei30 closed this as completed Sep 5, 2019
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

1 participant