[
https://issues.apache.org/jira/browse/DISPATCH-184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15330704#comment-15330704
]
ASF GitHub Bot commented on DISPATCH-184:
-----------------------------------------
GitHub user jdanekrh opened a pull request:
https://github.com/apache/qpid-dispatch/pull/82
DISPATCH-184 - Resolve port name to int when applying configuration
Error in router is caused by a call to getaddrinfo() that uses the 'amqp'
string for port In function qdpn_listener_t *qdpn_listener(qdpn_driver_t
*driver, ...). Same call to getaddrinfo() also appears in qdpn_connector().
There ia a Python class Url.Port() that converts a string port to int and
can handle missing /etc/services. Class used to be in dispatch in proton_future
package, it was recently removed and now it is only in Proton.
As a solution, I had the following ideas:
1. Add a Port type to python/qpid_dispatch_internal/management/schema.py,
do the conversion to int as part of validation.
2. Convert port to int in python/qpid_dispatch_internal/management/agent.py
in ListenerEntity and ConnectorEntity, either in validate, create, or init
method.
3. Catch the error code in qdpn_listener and qdpn_connector and do a if
strcmp(port, "amqp") ... there, Or call into Url.Port() in Python to avoid code
duplication.
I decided to do a PR with the 2nd one.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jdanekrh/qpid-dispatch DISPATCH-184
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/qpid-dispatch/pull/82.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #82
----
commit 1915320451d2dfc7ec410887585a09de41685a5c
Author: Jiri Danek <[email protected]>
Date: 2016-06-14T20:46:38Z
DISPATCH-184 - Resolve port name to int when applying configuration
Port can be specified either as a string, e.g. 'amqp', or a number. Some
systems do not have 'amqp' in /etc/services. On such systems, port has
to be resolved by dispatch itself.
----
> dispatch do not stop when 'amqp' is not defined
> -----------------------------------------------
>
> Key: DISPATCH-184
> URL: https://issues.apache.org/jira/browse/DISPATCH-184
> Project: Qpid Dispatch
> Issue Type: Bug
> Components: Container
> Environment: Gentoo linux, Linux falka 4.2.3-gentoo #1 SMP Thu Oct 8
> 10:08:43 CEST 2015 x86_64 Intel(R) Core(TM) i7-4600U CPU @ 2.10GHz
> GenuineIntel GNU/Linux
> proton-c (latest from apache github a16c58a59c2a5504ecd556dd397b7d28cc68dbd4)
> dispatch (latest from apache github 8353ac674a7150a1bbfa63c912ad9689a492e84a)
> sys-devel/gcc-4.9.3
> dev-lang/python-2.7.10
> Reporter: Zdenek Kraus
> Priority: Minor
> Attachments: python_qdstat-g_fc23.stacktrace
>
>
> If there is no existent record of 'amqp' protocol being 5672/tcp in
> /etc/services, dispatch logs error messages and continue on.
> steps:
> 1. make sure that record 'amqp 5672/tcp' is not present at /etc/services
> 2. run qpid dispatch
> current results:
> Wed Oct 21 16:11:35 2015 DRIVER (error) getaddrinfo(0.0.0.0, amqp): Servname
> not supported for ai_socktype
> and continue.
> expected:
> error message and should stop with error.
> note: this could be added into documentation
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]