You are viewing a plain text version of this content. The canonical link for it is here.
Posted to devnull@infra.apache.org by "beiwei30 (GitHub)" <gi...@apache.org> on 2018/08/22 13:35:33 UTC

[GitHub] [incubator-dubbo] beiwei30 commented on pull request #2185: Direct return when the server goes down unnormally.

I guess we may possibly avoid introducing `UNFINISHED_REQUESTS` by doing this:

```java
        for (long id : CHANNELS.keySet()) {
            if (channel.equals(CHANNELS.get(id))) {
                DefaultFuture future = getFuture(id);
                if (!future.isDone()) {
                    Response disconnectResponse = new Response(r.getId());
                    disconnectResponse.setStatus(Response.CHANNEL_INACTIVE);
                    disconnectResponse.setErrorMessage("Channel " + channel + " is inactive. Directly return the unFinished request.");
                    DefaultFuture.received(channel, disconnectResponse);
                }
            }
        }
```

[ Full content available at: https://github.com/apache/incubator-dubbo/pull/2185 ]
This message was relayed via gitbox.apache.org for devnull@infra.apache.org