-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22864/
-----------------------------------------------------------

(Updated June 24, 2014, 1:01 p.m.)


Review request for qpid, Alan Conway, Kenneth Giusti, Darryl Pierce, and Rafael 
Schloming.


Changes
-------

New patch version with incorporated Alan's comments.

Automated tests failures (will have a look on them):
1)
ha_tests.RecoveryTests.test_queue_hold .................................. fail
Error during test:  Traceback (most recent call last):
    File "/data_xfs/qpid/cpp/BLD/src/tests/python/commands/qpid-python-test", 
line 340, in run
      phase()
    File "/data_xfs/qpid/cpp/src/tests/ha_tests.py", line 1136, in 
test_queue_hold
      s1 = cluster.connect(0, 
native=True).session().sender("q1;{create:always}")
    File "/data_xfs/qpid/cpp/src/tests/ha_test.py", line 353, in connect
      return self[i].connect(reconnect=True, 
reconnect_urls=self.url.split(","), **kwargs)
    File "/data_xfs/qpid/cpp/src/tests/brokertest.py", line 350, in connect
      return connection_class.establish(self.host_port(), timeout=timeout, 
**kwargs)
    File "/data_xfs/qpid/cpp/BLD/src/tests/python/qpid/messaging/endpoints.py", 
line 67, in establish
      conn = Connection(url, **options)
    File "/data_xfs/qpid/cpp/BLD/src/tests/python/qpid/messaging/endpoints.py", 
line 161, in __init__
      raise ConnectionError("Connection option 'protocol' value '" + value + "' 
unsupported (must be amqp0-10)")
  TypeError: cannot concatenate 'str' and 'bool' objects


2) _all_ qpidd_qmfv2_tests failed like this one:
qpidd_qmfv2_tests.ConsoleTest.test_async_method ......................... fail
Error during test:  Traceback (most recent call last):
    File "/data_xfs/qpid/cpp/BLD/src/tests/python/commands/qpid-python-test", 
line 340, in run
      phase()
    File "/data_xfs/qpid/cpp/src/tests/qpidd_qmfv2_tests.py", line 254, in 
test_async_method
      self._startBroker()
    File "/data_xfs/qpid/cpp/src/tests/qpidd_qmfv2_tests.py", line 53, in 
_startBroker
      self.broker = BrokerTest.broker(self, args)
    File "/data_xfs/qpid/cpp/src/tests/brokertest.py", line 531, in broker
      raise RethrownException("Failed to start broker %s(%s): %s" % (b.name, 
b.log, e))
  RethrownException: Failed to start broker broker0(000:broker0.log): Broker 
broker0 not responding: (None(Connection option 'protocol' value 'amqp1.0' 
unsupported (must be amqp0-10))):
      2014-06-24 13:18:11 [Store] notice Journal "TplStore": Created
      2014-06-24 13:18:11 [Store] notice Store module initialized; 
store-dir=broker0
      2014-06-24 13:18:11 [Broker] notice SASL disabled: No Authentication 
Performed
      2014-06-24 13:18:11 [Network] notice Listening on TCP/TCP6 port 37940
      2014-06-24 13:18:11 [Broker] notice Broker running

  Traceback (most recent call last):
    File "/data_xfs/qpid/cpp/src/tests/brokertest.py", line 408, in ready
      c = self.connect(timeout=timeout, **kwargs)
    File "/data_xfs/qpid/cpp/src/tests/brokertest.py", line 350, in connect
      return connection_class.establish(self.host_port(), timeout=timeout, 
**kwargs)
    File "/data_xfs/qpid/cpp/BLD/src/tests/python/qpid/messaging/endpoints.py", 
line 67, in establish
      conn = Connection(url, **options)
    File "/data_xfs/qpid/cpp/BLD/src/tests/python/qpid/messaging/endpoints.py", 
line 161, in __init__
      raise ConnectionError("Connection option 'protocol' value '" + value + "' 
unsupported (must be amqp0-10)")
  ConnectionError: None(Connection option 'protocol' value 'amqp1.0' 
unsupported (must be amqp0-10))

  Traceback (most recent call last):
    File "/data_xfs/qpid/cpp/src/tests/brokertest.py", line 529, in broker
      try: b.ready()
    File "/data_xfs/qpid/cpp/src/tests/brokertest.py", line 417, in ready
      self.name,e,error_line(self.log, 5)))
  RethrownException: Broker broker0 not responding: (None(Connection option 
'protocol' value 'amqp1.0' unsupported (must be amqp0-10))):
      2014-06-24 13:18:11 [Store] notice Journal "TplStore": Created
      2014-06-24 13:18:11 [Store] notice Store module initialized; 
store-dir=broker0
      2014-06-24 13:18:11 [Broker] notice SASL disabled: No Authentication 
Performed
      2014-06-24 13:18:11 [Network] notice Listening on TCP/TCP6 port 37940
      2014-06-24 13:18:11 [Broker] notice Broker running

  Traceback (most recent call last):
    File "/data_xfs/qpid/cpp/src/tests/brokertest.py", line 408, in ready
      c = self.connect(timeout=timeout, **kwargs)
    File "/data_xfs/qpid/cpp/src/tests/brokertest.py", line 350, in connect
      return connection_class.establish(self.host_port(), timeout=timeout, 
**kwargs)
    File "/data_xfs/qpid/cpp/BLD/src/tests/python/qpid/messaging/endpoints.py", 
line 67, in establish
      conn = Connection(url, **options)
    File "/data_xfs/qpid/cpp/BLD/src/tests/python/qpid/messaging/endpoints.py", 
line 161, in __init__
      raise ConnectionError("Connection option 'protocol' value '" + value + "' 
unsupported (must be amqp0-10)")
  ConnectionError: None(Connection option 'protocol' value 'amqp1.0' 
unsupported (must be amqp0-10))


3) Same error in all legacystore_python_tests tests


Bugs: QPID-5836
    https://issues.apache.org/jira/browse/QPID-5836


Repository: qpid


Description
-------

options need to be iterated to identify possible unknown options. Default 
values (even None, otherwise Python complains it does not know them) have to be 
set before the loop that overwrites the defaults.

This is in my eyes better option than adding an extra check like:

for key in options.keys():
  if key not in ["reconnect", "transport", "port", .. ]:
    raise error

As this check would have to be maintained and there is a risk one forgets to 
add a new connection option there while handling it otherwise.

The code change is more than reasonable but several automated tests failed - 
some of them (like ha_tests.RecoveryTests.test_queue_hold) due to connection 
option protocol:amqp1.0. While that option should be present _only_ for swig 
client that does not call endpoints.py and Connection class. Other test 
failures are not directly related to that "missing" option but I guess it would 
be the indirect reason (some connection supposed to provision something failed 
due to that option, so the provisioning was missing etc.).

Any idea where & why _native_ client sets protocol:amqp1.0 ? (I even added the 
possibility protocol:amqp0-10 but that didnt help, obviously). Automated tests 
results added.


Diffs (updated)
-----

  /trunk/qpid/python/qpid/messaging/endpoints.py 1604713 

Diff: https://reviews.apache.org/r/22864/diff/


Testing (updated)
-------

Manual test with connection option {'a':'b'} raises error:

Traceback (most recent call last):
  File "get_queue_arguments.py", line 17, in <module>
    connection = Connection(brokerurl, **parms)
  File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 
195, in __init__
    raise ConnectionError("Unknown connection option " + key + " with value " + 
value)
qpid.messaging.exceptions.ConnectionError: None(Unknown connection option a 
with value b)


Thanks,

Pavel Moravec

Reply via email to