Dubbo: Pontential problems of argument callback mechanism.

Created on 8 Jan 2018  ·  3Comments  ·  Source: apache/dubbo

在CallbackServiceCodec中的以下方法

@SuppressWarnings({"unchecked", "rawtypes"})
private static String exportOrunexportCallbackService(Channel channel, URL url, Class clazz, Object inst, Boolean export) throws IOException {
int instid = System.identityHashCode(inst);
...
}
上面这段代码 如果我传递过来的inst 是个匿名函数,每次调用 instid都是不同的值,这样会导致
isInstancesOverLimit 这个方法一直返回false
increaseInstanceCount 会一直累加,导致溢出

我现在尽量避免使用回调了,但是想到这有可能是个问题,所以提出来看看有什么好的解决方式

typenhancement

Most helpful comment

I don't recommend you use this feature:

  1. We plan to support async on provider side like AsyncContext of Servlet3.0
  2. We may find a new way of supporting the streaming push ability provided by current callback mechanism.

All 3 comments

I have checked the callback mechanism:

  1. I think you don't have to use an new callback instance every time.
  2. Dubbo have a default 1000 limit of callback instance for each channel.

I don't recommend you use this feature:

  1. We plan to support async on provider side like AsyncContext of Servlet3.0
  2. We may find a new way of supporting the streaming push ability provided by current callback mechanism.

Hi, @caijunjun
The new version of Dubbo is very good for async support, you can get more information here:
http://dubbo.apache.org/zh-cn/blog/dubbo-new-async.html

Was this page helpful?
0 / 5 - 0 ratings