You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Jiri Danek (JIRA)" <ji...@apache.org> on 2016/06/10 08:41:20 UTC

[jira] [Comment Edited] (DISPATCH-184) dispatch do not stop when 'amqp' is not defined

    [ https://issues.apache.org/jira/browse/DISPATCH-184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15324085#comment-15324085 ] 

Jiri Danek edited comment on DISPATCH-184 at 6/10/16 8:40 AM:
--------------------------------------------------------------

Issue is still present. If I delete my amqp lines from {{/etc/services}}, then with the default config this happens:

{noformat}
mv /etc/services /etc/services_
qdrouterd &
Fri Jun 10 07:41:42 2016 SERVER (info) Container Name: Router.A
Fri Jun 10 07:41:42 2016 ROUTER (info) Router started in Standalone mode
Fri Jun 10 07:41:42 2016 ROUTER_CORE (info) Router Core thread running. 0/Router.A
Fri Jun 10 07:41:42 2016 ROUTER_CORE (info) In-process subscription M/$management
Fri Jun 10 07:41:42 2016 AGENT (info) Activating management agent on $_management_internal
Fri Jun 10 07:41:42 2016 ROUTER_CORE (info) In-process subscription L/$management
Fri Jun 10 07:41:42 2016 ROUTER_CORE (info) In-process subscription L/$_management_internal
Fri Jun 10 07:41:42 2016 DISPLAYNAME (info) Activating DisplayNameService on $displayname
Fri Jun 10 07:41:42 2016 ROUTER_CORE (info) In-process subscription L/$displayname
Fri Jun 10 07:41:42 2016 CONN_MGR (info) Configured Listener: 0.0.0.0:amqp proto=any role=normal
Fri Jun 10 07:41:42 2016 DRIVER (error) getaddrinfo(0.0.0.0, amqp): Servname not supported for ai_socktype
Fri Jun 10 07:41:42 2016 POLICY (info) Policy configured maximumConnections: 0, policyFolder: '', access rules enabled: 'false'
Fri Jun 10 07:41:42 2016 POLICY (info) Policy fallback defaultApplication is disabled
Fri Jun 10 07:41:42 2016 SERVER (info) Operational, 4 Threads Running

# qdstat -g
Segmentation fault
{noformat}

(core from {{qdstat -g}} on Fedora 23 is attached)

Dispatch is supposed to work even without the amqp line in {{/etc/services}}, because [qpid-dispatch/python/qpid_dispatch_internal/proton_future/__init__.py|https://github.com/apache/qpid-dispatch/blob/2b1d8f67f3ad5dd25edaf8fc71117988a14e102d/python/qpid_dispatch_internal/proton_future/__init__.py#L3782] contains this function, which should be called to take care of the problem.

{code}
    @staticmethod
    def _port_int(value):
      """Convert service, an integer or a service name, into an integer port number."""
      try:
        return int(value)
      except ValueError:
        try:
          return socket.getservbyname(value)
        except socket.error:
          # Not every system has amqp/amqps defined as a service
          if value == Url.AMQPS:  return 5671
          elif value == Url.AMQP: return 5672
          else:
            raise ValueError("Not a valid port number or service name: '%s'" % value)
{code}


was (Author: jdanek):
Issue is still present. If I delete my amqp lines from {{/etc/services}}, then with the default config this happens:

{noformat}
mv /etc/services /etc/services_
qdrouterd &
Fri Jun 10 07:41:42 2016 SERVER (info) Container Name: Router.A
Fri Jun 10 07:41:42 2016 ROUTER (info) Router started in Standalone mode
Fri Jun 10 07:41:42 2016 ROUTER_CORE (info) Router Core thread running. 0/Router.A
Fri Jun 10 07:41:42 2016 ROUTER_CORE (info) In-process subscription M/$management
Fri Jun 10 07:41:42 2016 AGENT (info) Activating management agent on $_management_internal
Fri Jun 10 07:41:42 2016 ROUTER_CORE (info) In-process subscription L/$management
Fri Jun 10 07:41:42 2016 ROUTER_CORE (info) In-process subscription L/$_management_internal
Fri Jun 10 07:41:42 2016 DISPLAYNAME (info) Activating DisplayNameService on $displayname
Fri Jun 10 07:41:42 2016 ROUTER_CORE (info) In-process subscription L/$displayname
Fri Jun 10 07:41:42 2016 CONN_MGR (info) Configured Listener: 0.0.0.0:amqp proto=any role=normal
Fri Jun 10 07:41:42 2016 DRIVER (error) getaddrinfo(0.0.0.0, amqp): Servname not supported for ai_socktype
Fri Jun 10 07:41:42 2016 POLICY (info) Policy configured maximumConnections: 0, policyFolder: '', access rules enabled: 'false'
Fri Jun 10 07:41:42 2016 POLICY (info) Policy fallback defaultApplication is disabled
Fri Jun 10 07:41:42 2016 SERVER (info) Operational, 4 Threads Running

# qdstat -g
Segmentation fault
{noformat}

(core from {{qdstat -g}} on Fedora 23 is attached)

Dispatch is supposed to work even without the amqp line in {{/etc/services}}, because [qpid-dispatch/python/qpid_dispatch_internal/proton_future/__init__.py
|https://github.com/apache/qpid-dispatch/blob/2b1d8f67f3ad5dd25edaf8fc71117988a14e102d/python/qpid_dispatch_internal/proton_future/__init__.py#L3782] contains this function, which should be called to take care of the problem.

{code}
    @staticmethod
    def _port_int(value):
      """Convert service, an integer or a service name, into an integer port number."""
      try:
        return int(value)
      except ValueError:
        try:
          return socket.getservbyname(value)
        except socket.error:
          # Not every system has amqp/amqps defined as a service
          if value == Url.AMQPS:  return 5671
          elif value == Url.AMQP: return 5672
          else:
            raise ValueError("Not a valid port number or service name: '%s'" % value)
{code}

> 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: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org