Archived

This forum has been archived. Please start a new discussion on GitHub.

glacier2router bug?

java code:
Ice.Communicator ic =Ice.Util.initialize(args);
Ice.ObjectPrx tmp = ic.stringToProxy("DemoGlacier2/router:tcp -p 4064 -h 127.0.0.1");
RouterPrx router = RouterPrxHelper.checkedCast(tmp);
try {
SessionPrx session = router.createSession("a", "b");
Ice.ObjectPrx base = ic.stringToProxy("callback:tcp -h 127.0.0.1 -p 10000").ice_router(router);
CallbackPrx twoway = CallbackPrxHelper.checkedCast(base);
} catch (CannotCreateSessionException e) {
e.printStackTrace();
} catch (PermissionDeniedException e) {
e.printStackTrace();
}finally{
if (router != null) {
try {
router.destroySession();
} catch (Throwable ex) {
}
router = null;
}
if (ic != null) {
try {
ic.destroy();
} catch (Throwable ex) {
}
ic = null;
}
}

run >=10000w times,"glacier2router.exe" use more and more Memory,at last "glacier2router.exe" is no response.exception:

Caused by: Ice.ConnectionLostException
error = 0
at IceInternal.ConnectRequestHandler.getConnection(ConnectRequestHandler.java:240)
at IceInternal.ConnectRequestHandler.sendRequest(ConnectRequestHandler.java:138)
at IceInternal.Outgoing.invoke(Outgoing.java:66)
at Glacier2._RouterDelM.createSession(_RouterDelM.java:44)

client invoke destroy() free memory,but glacier2router.exe does not free memory.
I wonder whether the problem is glacier2router.exe config was wrong, or glacier2router.exe has bug?

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Could you post your Glacier2 configuration file? Do you set the Glacier2.SessionTimeout property? I tried reproducing the problem with Ice 3.4.1 without luck, glacier2 memory remains stable. Which Ice version do you use?

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    Could you post your Glacier2 configuration file? Do you set the Glacier2.SessionTimeout property? I tried reproducing the problem with Ice 3.4.1 without luck, glacier2 memory remains stable. Which Ice version do you use?

    Cheers,
    Benoit.



    Glacier2 configuration file:

    Glacier2.InstanceName=*
    Glacier2.Client.Endpoints=ssl -p 9527 -h *
    Glacier2.Server.Endpoints=tcp -h *
    Glacier2.PermissionsVerifier=PermissionsVerifier:tcp -h * -p 10000
    Glacier2.SessionTimeout=30
    Glacier2.Client.ForwardContext=1
    Glacier2.Server.ForwardContext=1
    Ice.ThreadPool.Server.Size=90
    Ice.ThreadPool.Server.SizeWarn=90
    Ice.ThreadPool.Server.SizeMax=100
    Ice.Override.Compress=1
    Ice.Warn.Connections=0
    Ice.Plugin.IceSSL=IceSSL:createIceSSL
    IceSSL.DefaultDir=certs
    IceSSL.CertAuthFile=cacert.pem
    IceSSL.CertFile=s_rsa1024_pub.pem
    IceSSL.KeyFile=s_rsa1024_priv.pem

    Ice version 3.4.1.
    Client invokes the router.destroySession() method, Do not destroy the server session?
    glacier2router.exe have to wait for the server Session Timeout, after the release of memory?
  • benoit
    benoit Rennes, France
    Hi,

    Why do you set the thread pool size on Glacier2? This shouldn't be necessary. I also don't see how such a configuration file could possibly work, it is allowed to pass "-h *" to a proxy endpoint so your permissions verifier property is incorrect. I would also recommend using a more descriptive instance name.

    I take it from your configuration that you are not using a session manager?

    I tried reproducing the problem with a similar configuration and I'm still not seeing any leaks in Glacier2. Which platform do you use? Could you perhaps create a small test case that we could use to duplicate the issue?

    Cheers,
    Benoit
  • benoit wrote: »
    Hi,

    Why do you set the thread pool size on Glacier2? This shouldn't be necessary. I also don't see how such a configuration file could possibly work, it is allowed to pass "-h *" to a proxy endpoint so your permissions verifier property is incorrect. I would also recommend using a more descriptive instance name.

    I take it from your configuration that you are not using a session manager?

    I tried reproducing the problem with a similar configuration and I'm still not seeing any leaks in Glacier2. Which platform do you use? Could you perhaps create a small test case that we could use to duplicate the issue?

    Cheers,
    Benoit

    Use Ice instead webService,
    webService efficiency is too low
    Only use the user authentication session,
    the number of Session is not under control
    could you provide relevant examples
  • benoit
    benoit Rennes, France
    Hi,

    The Glacier2 demo from the demo/Glacier2/callback directory demonstrates the use of Glacier2 without a session manager. Could you try to modify the demo to reproduce the problem? Please also specify which platform you're using.

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    The Glacier2 demo from the demo/Glacier2/callback directory demonstrates the use of Glacier2 without a session manager. Could you try to modify the demo to reproduce the problem? Please also specify which platform you're using.

    Cheers,
    Benoit.

    win 7
    Ice 3.4.1
    jdk 1.6
  • benoit
    benoit Rennes, France
    Hi,

    How is the Glacier2 memory increasing (how many MB for a given time)? Does it stabilises at one point? Why do you think it's related to the ConnectionLostException? From your sample code I can observe that the client connection sometime timeouts because it sends too many requests. The connection timeout causes the connection to Glacier2 to be closed and a ConnectionLostException on the Glacier2 side. I'm not seeing the Glacier2 memory increasing.

    Why do configure Size=100/SizeMax=1000 for the Glacier2 router thread pool? This shouldn't be necessary, Glacier2 can work with a single thread and still handle many concurrent calls efficiently.

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    How is the Glacier2 memory increasing (how many MB for a given time)? Does it stabilises at one point? Why do you think it's related to the ConnectionLostException? From your sample code I can observe that the client connection sometime timeouts because it sends too many requests. The connection timeout causes the connection to Glacier2 to be closed and a ConnectionLostException on the Glacier2 side. I'm not seeing the Glacier2 memory increasing.

    Why do configure Size=100/SizeMax=1000 for the Glacier2 router thread pool? This shouldn't be necessary, Glacier2 can work with a single thread and still handle many concurrent calls efficiently.

    Cheers,
    Benoit.
    Attachment not found.

    glacier2router.exe, client must not be run on the same machine,IP can not use 127.0.0.1.
    Modified:

    win7
    jdk 1.6
    ice 3.4.1

    Routing Server (win7) only run glacier2router.exe.IP: 10.68.8.45
    Application Server (win7). IP: 10.2.40.40
    The third server(win7) Running Test.java IP:202.10.10.19, in the case of connecting a small memory automatically released. has remained at around 5M.
    When a client too many connections
    An exception unstable after the change. glacier2router.exe not automatically release the memory,
    taking up more and more memory, and finally Ben collapse

    Ice.ConnectFailedException
    error = 0
    at IceInternal.ConnectRequestHandler.getConnection(ConnectRequestHandler.java:240)
    at IceInternal.ConnectRequestHandler.sendRequest(ConnectRequestHandler.java:138)
    at IceInternal.Outgoing.invoke(Outgoing.java:66)
    at Glacier2._RouterDelM.createSession(_RouterDelM.java:44)
    at Glacier2.RouterPrxHelper.createSession(RouterPrxHelper.java:129)
    at Glacier2.RouterPrxHelper.createSession(RouterPrxHelper.java:67)
    at com.hna.te.client.Te.run(Test.java:34)
    Caused by: java.net.ConnectException: Connection timed out: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:574)
    at IceInternal.Network.doFinishConnect(Network.java:354)
    at IceSSL.TransceiverI.initialize(TransceiverI.java:37)
    at Ice.ConnectionI.initialize(ConnectionI.java:1786)
    at Ice.ConnectionI.message(ConnectionI.java:1038)
    at IceInternal.ThreadPool.run(ThreadPool.java:302)
    at IceInternal.ThreadPool.access$300(ThreadPool.java:12)
    at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:643)
    at java.lang.Thread.run(Thread.java:619)

    finally :
    glacier2router.exe use Memory 2G.Per 500 Communicator takes about 10M memory
    Caused by: Ice.ConnectionLostException
    error = 0
    at IceInternal.ConnectRequestHandler.getConnection(Co nnectRequestHandler.java:240)
    at IceInternal.ConnectRequestHandler.sendRequest(Conn ectRequestHandler.java:138)
    at IceInternal.Outgoing.invoke(Outgoing.java:66)
    at Glacier2._RouterDelM.createSession(_RouterDelM.jav a:44)
  • benoit wrote: »
    Hi,

    How is the Glacier2 memory increasing (how many MB for a given time)? Does it stabilises at one point? Why do you think it's related to the ConnectionLostException? From your sample code I can observe that the client connection sometime timeouts because it sends too many requests. The connection timeout causes the connection to Glacier2 to be closed and a ConnectionLostException on the Glacier2 side. I'm not seeing the Glacier2 memory increasing.

    Why do configure Size=100/SizeMax=1000 for the Glacier2 router thread pool? This shouldn't be necessary, Glacier2 can work with a single thread and still handle many concurrent calls efficiently.

    Cheers,
    Benoit.

    操!
    Finally found a reason!
    tcp, udp protocol no problem, memory to maintain normal
    ssl protocol does not release memory
  • benoit
    benoit Rennes, France
    Hi,

    Ok, thanks for the information, we are investigating this and we'll let you know when we know more.

    Cheers,
    Benoit.
  • mes
    mes California
    Hi,

    We've posted a patch for this problem. If you prefer, we can also send you patched binaries for the IceSSL DLL.

    Thanks again for reporting this.

    Best regards,
    Mark
  • mes wrote: »
    Hi,

    We've posted a patch for this problem. If you prefer, we can also send you patched binaries for the IceSSL DLL.

    Thanks again for reporting this.

    Best regards,
    Mark

    Could you send me patched binaries for the IceSSL DLL.
    email:lb_liu1@hnair.com
    Thanks