You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Gordon Sim (JIRA)" <ji...@apache.org> on 2014/07/24 14:37:39 UTC

[jira] [Reopened] (QPID-5852) [Python client] connection.opened() returns True after unsuccessful connection

     [ https://issues.apache.org/jira/browse/QPID-5852?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gordon Sim reopened QPID-5852:
------------------------------


The fix for this bug causes a recursion when the connection is lost. E.g. drain -f amq.fanout, then kill the broker:

{noformat}
 File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 344, in close
    ssn.close(timeout=timeout)
  File "<string>", line 6, in close
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 768, in close
    self.sync(timeout=timeout)
  File "<string>", line 6, in sync
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 759, in sync
    if not self._ewait(lambda: not self.outgoing and not self.acked, timeout=timeout):
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 594, in _ewait
    result = self.connection._ewait(lambda: self.error or predicate(), timeout)
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 233, in _ewait
    self.check_error()
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 225, in check_error
    self.close()
  File "<string>", line 6, in close
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 344, in close
    ssn.close(timeout=timeout)
  File "<string>", line 6, in close
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 768, in close
    self.sync(timeout=timeout)
  File "<string>", line 6, in sync
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 759, in sync
    if not self._ewait(lambda: not self.outgoing and not self.acked, timeout=timeout):
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 594, in _ewait
    result = self.connection._ewait(lambda: self.error or predicate(), timeout)
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 233, in _ewait
    self.check_error()
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 225, in check_error
    self.close()
  File "<string>", line 6, in close
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 344, in close
    ssn.close(timeout=timeout)
  File "<string>", line 6, in close
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 768, in close
    self.sync(timeout=timeout)
  File "<string>", line 6, in sync
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 759, in sync
    if not self._ewait(lambda: not self.outgoing and not self.acked, timeout=timeout):
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 594, in _ewait
    result = self.connection._ewait(lambda: self.error or predicate(), timeout)
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 233, in _ewait
    self.check_error()
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 225, in check_error
    self.close()
  File "<string>", line 6, in close
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 346, in close
    self.detach(timeout=timeout)
  File "<string>", line 6, in detach
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 318, in detach
    self._wakeup()
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/messaging/endpoints.py", line 211, in _wakeup
    self._modcount += 1
  File "/home/gordon/projects/qpid-svn-trunk/python/qpid/datatypes.py", line 150, in __add__
    return Serial(self.value + other)
RuntimeError: maximum recursion depth exceeded
{noformat}

> [Python client]  connection.opened() returns True after unsuccessful connection 
> --------------------------------------------------------------------------------
>
>                 Key: QPID-5852
>                 URL: https://issues.apache.org/jira/browse/QPID-5852
>             Project: Qpid
>          Issue Type: Bug
>          Components: Python Client
>    Affects Versions: 0.28
>            Reporter: Pavel Moravec
>            Assignee: Pavel Moravec
>            Priority: Trivial
>             Fix For: 0.29
>
>
> Description of problem:
> When python connection fails to connect to a broker, connection status is opened == True. After unsuccessfull connection, the state of Connection object should be False.
> How reproducible:
> 100%
> Steps to Reproduce:
> 1. create a connection to nonexisting broker in python
> 2. check return value od connection.opened()
> (or see below reproducer)
> Actual results:
> True
> Expected results:
> False
> Reproducer script:
> from qpid.messaging import *
> parms = {}
> try:
>   connection = Connection("invalid-hostname", **parms)
>   connection.open()
> except ConnectionError,e:
>   print e
> print "connection.opened=%s" %(connection.opened())



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org