Results 1 to 7 of 7

Thread: glacier2 bug

  1. #1
    Andrew is offline Registered User
    Name: Andrea Nicotra
    Organization: Personal
    Project: Backend for IPTV
    Join Date
    Jan 2008
    Posts
    29

    Unhappy glacier2 bug

    I found a bug on glacier:

    environment:
    adapter1: id reciver-1 (with object test/00001)

    adapter2: id reciver-2

    glacier2 (configured with default Session Manager)

    Client connected by Glacier2

    if the client create a proxy by a string an then ping, it go right, then if I create a proxy with the same ice id but different adapter it go right too, but it will fail, it's true?

    ex
    Code:
    proxyStr = "test/00001 -t @ reciverService-1"
    proxyFake = "test/00001 -t @ reciverService-2"
    
    self.__router Glacier2.RouterPrx.checkedCast(self.communicator().getDefaultRouter())
    self.__router.createSession("test", "test")
    
    try:
          proxy = self.communicator().stringToProxy(proxyStr)
          print "ice_ping",proxy
          proxy.ice_ping()
    except Exception as ex:
          print ex
    
    try:
          proxy2 = self.communicator().stringToProxy(proxyFake)
          print "ice_ping",proxy2
          proxy2.ice_ping()
    except Exception as ex:
          print ex
    
    then if I close/open the session and try to ping the fake proxy the clinet go to loop
    I attach an example
    Attached Files Attached Files

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Andrea,

    With Ice, each object ID is supposed to be unique (within the scope of a given application/deployment). You can't / shouldn't have two separate objects with the same ID, and if you do, sometimes your application may work, sometimes you will get unexpected and hard-to-figure out results.

    Within a Glacier2 session, you are actually assigning a proxy to an object ID the first time you make a call on a given object. So the expected behavior with your little test is:
    Code:
       proxy = self.communicator().stringToProxy(proxyStr)
       proxy.ice_ping()
    The Glacier2 router forwards this ice_ping to the test/00001 object, and to do so Glacier2 resolves the provided adapter-ID using its configured Ice locator.

    Code:
       proxy2 = self.communicator().stringToProxy(proxyFake)
       proxy2.ice_ping()
    The Glacier2 router forwards this ice_ping to the same (first) test/00001 object, because the previous called associated a proxy to this object ID.

    Then, if you want to test session closing and reestablishment, please upgrade to Ice 3.4.1; Ice 3.4.1 incorporates a number of bug fixes and enhancements in this area.

    All the best,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  3. #3
    Andrew is offline Registered User
    Name: Andrea Nicotra
    Organization: Personal
    Project: Backend for IPTV
    Join Date
    Jan 2008
    Posts
    29
    Quote Originally Posted by bernard View Post
    Hi Andrea,

    With Ice, each object ID is supposed to be unique (within the scope of a given application/deployment). You can't / shouldn't have two separate objects with the same ID, and if you do, sometimes your application may work, sometimes you will get unexpected and hard-to-figure out results.

    Within a Glacier2 session, you are actually assigning a proxy to an object ID the first time you make a call on a given object. So the expected behavior with your little test is:
    Code:
       proxy = self.communicator().stringToProxy(proxyStr)
       proxy.ice_ping()
    The Glacier2 router forwards this ice_ping to the test/00001 object, and to do so Glacier2 resolves the provided adapter-ID using its configured Ice locator.

    Code:
       proxy2 = self.communicator().stringToProxy(proxyFake)
       proxy2.ice_ping()
    The Glacier2 router forwards this ice_ping to the same (first) test/00001 object, because the previous called associated a proxy to this object ID.

    Then, if you want to test session closing and reestablishment, please upgrade to Ice 3.4.1; Ice 3.4.1 incorporates a number of bug fixes and enhancements in this area.

    All the best,
    Bernard
    the same test without glacer don't have the same behaviour, I test that application with Ice 3.4.1.

  4. #4
    paolo is offline Registered User
    Name: paolo volpi
    Organization: tvblob
    Project: tvblob blobbox
    Join Date
    Aug 2007
    Posts
    22
    In Andrew application he is not assigning one Object Identity to 2 different objects, he just ask create 2 stringified proxy:

    "test/00001 -t @ reciverService-1"
    and
    "test/00001 -t @ reciverService-2"

    The first one is the correct one cause test/00001 Object is registered on reciverService-1 Adapter.

    The problem is that if he is behind glacier2 and try to resolve the first stringified proxy and after the second one, both Proxy can reach the object, if he try in reverse order both Proxy can't reach the object.

    The expected behaviour would be in both case to be able to reach the object always through the first Proxy("test/00001 -t @ reciverService-1" ) and never through the second one ("test/00001 -t @ reciverService-2" )

  5. #5
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Which behavior is expected depends on your perspective.

    My perspective is the Ice routing facility on which Glacier2 is built.

    As I mentioned earlier, the Glacier2 router maintains a table object ID to proxy (for each session), with the help of the Ice client runtime. When you first call an operation on a "routed proxy", the Ice client runtime first registers this proxy with the router's table, and then sends the request to the router, which in turns forwards it to the actual target (using the provided proxy).

    The size of this per-session table is Glacier2.RoutingTable.MaxSize, set to 1,000 by default. So, with your first example, you could do:
    - invoke on good routed proxy (success)
    - invoke on 1,000 other routed proxies
    - invoke on fake proxy (fails, since the good routed proxy is no longer cached in the Glacier routing table).

    Your second example shows that the Glacier2 router keeps your bad proxy, even after a request on this bad proxy returns an exception. This behavior is currently not documented, and I agree that it should be. One related question is if/when the Glacier2 router should drop a proxy that returned an exception: for any system exception, or just a few exceptions like ObjectNotExistException or ConnectionRefused?

    I see that your own expectation is that Glacier2 is totally transparent to the application--that everything behaves like with direct client-server communications, but that's quite true:

    Quote Originally Posted by paolo View Post

    The expected behaviour would be in both case to be able to reach the object always through the first Proxy("test/00001 -t @ reciverService-1" ) and never through the second one ("test/00001 -t @ reciverService-2" )
    I hope this is clearer now.

    Naturally, the larger question is what are you trying to achieve here? An application should definitely never use a pair of proxies like "test/00001 -t @ reciverService-1" and "test/00001 -t @ reciverService-2"; if this object is replicated on several servers, you should use a single proxy like "test/00001 @ replicatedService".

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  6. #6
    Andrew is offline Registered User
    Name: Andrea Nicotra
    Organization: Personal
    Project: Backend for IPTV
    Join Date
    Jan 2008
    Posts
    29
    Quote Originally Posted by Andrew View Post
    I found a bug on glacier:

    environment:
    adapter1: id reciver-1 (with object test/00001)

    adapter2: id reciver-2

    glacier2 (configured with default Session Manager)

    Client connected by Glacier2

    if the client create a proxy by a string an then ping, it go right, then if I create a proxy with the same ice id but different adapter it go right too, but it will fail, it's true?

    ex
    Code:
    proxyStr = "test/00001 -t @ reciverService-1"
    proxyFake = "test/00001 -t @ reciverService-2"
    
    self.__router Glacier2.RouterPrx.checkedCast(self.communicator().getDefaultRouter())
    self.__router.createSession("test", "test")
    
    try:
          proxy = self.communicator().stringToProxy(proxyStr)
          print "ice_ping",proxy
          proxy.ice_ping()
    except Exception as ex:
          print ex
    
    try:
          proxy2 = self.communicator().stringToProxy(proxyFake)
          print "ice_ping",proxy2
          proxy2.ice_ping()
    except Exception as ex:
          print ex
    
    then if I close/open the session and try to ping the fake proxy the clinet go to loop
    I attach an example
    The example is only to reproduce and explain the kind of issue, nothing more. (I don't try to archive something)

  7. #7
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Andrea,

    We looked at your test-case, and it does indeed show a bug: when you reuse a proxy after closing/reopening a session, an invocation on this proxy blocks forever. We'll investigate.

    This bug also appears unrelated to the behavior of Ice+Glacier2 when using two proxies with the same object-id, which is in fact expected, as I described earlier in this thread.

    Thank you for this bug report.

    Bernard
    Bernard Normier
    ZeroC, Inc.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Possible bug in UdpEndpointI?
    By ngarimu in forum Help Center
    Replies: 2
    Last Post: 03-01-2010, 09:49 AM
  2. Bug of Glacier2Router
    By GlacierX in forum Bug Reports
    Replies: 5
    Last Post: 04-11-2007, 05:00 AM
  3. bug ?
    By OrNot in forum Bug Reports
    Replies: 1
    Last Post: 12-03-2005, 03:58 AM
  4. Is this a bug?
    By GlacierX in forum Bug Reports
    Replies: 5
    Last Post: 05-17-2005, 09:54 AM
  5. much like a Bug !
    By damingyipai in forum Bug Reports
    Replies: 4
    Last Post: 04-04-2004, 12:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •