Logic to obtain hypervisor hostname is not completely compatible with libvirt

Bug #1926693 reported by Takashi Kajinami
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Takashi Kajinami

Bug Description

Currently neutron uses socket.getshostname() to determine a heyervisor hostname assuming that is what is used in libvirt.

However libvirt actually relies on the following steps to generate hypervisor hostname and socket.gethostname() doesn't match in some cases.

/* Who knew getting a hostname could be so delicate. In Linux (and Unices
 * in general), many things depend on "hostname" returning a value that will
 * resolve one way or another. In the modern world where networks frequently
 * come and go this is often being hard-coded to resolve to "localhost". If
 * it *doesn't* resolve to localhost, then we would prefer to have the FQDN.
 * That leads us to 3 possibilities:
 *
 * 1) gethostname() returns an FQDN (not localhost) - we return the string
 * as-is, it's all of the information we want
 * 2) gethostname() returns "localhost" - we return localhost; doing further
 * work to try to resolve it is pointless
 * 3) gethostname() returns a shortened hostname - in this case, we want to
 * try to resolve this to a fully-qualified name. Therefore we pass it
 * to getaddrinfo(). There are two possible responses:
 * a) getaddrinfo() resolves to a FQDN - return the FQDN
 * b) getaddrinfo() fails or resolves to localhost - in this case, the
 * data we got from gethostname() is actually more useful than what
 * we got from getaddrinfo(). Return the value from gethostname()
 * and hope for the best.
 */

https://github.com/libvirt/libvirt/blob/ec2e3336b8c8df572600043976e1ab5feead656e/src/util/virutil.c#L454-L531

Acutally we do see that in TripleO deployment socket.gethostname() and virsh hostname don't agree, and this causes an issue when we set up resource_provider_bandwidths
~~~
[heat-admin@compute-0 ~]$ python
Python 3.6.8 (default, Dec 5 2019, 15:45:45)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostname()
'compute-0'
>>> exit()
[heat-admin@compute-0 ~]$ sudo podman exec -it nova_libvirt virsh hostname
compute-0.redhat.local
~~~

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/788893

Changed in neutron:
status: New → In Progress
Revision history for this message
Takashi Kajinami (kajinamit) wrote :

~~~
[heat-admin@compute-0 ~]$ python
Python 3.6.8 (default, Dec 5 2019, 15:45:45)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostname()
'compute-0'
>>> socket.getaddrinfo(host=socket.gethostname(), port=None, family=socket.AF_UNSPEC, flags=socket.AI_CANONNAME)[0][3]
'compute-0.redhat.local'
~~~

description: updated
description: updated
Changed in neutron:
assignee: nobody → Takashi Kajinami (kajinamit)
Changed in neutron:
importance: Undecided → High
Revision history for this message
Oliver Walsh (owalsh) wrote (last edit ):

As I pointed out in the ML, socket.gethostname docs state that it can return the shortname or the fqdn.

On my deployment:

[stack@central-hci-0 ~]$ python3
Python 3.6.8 (default, Dec 5 2019, 15:45:45)
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostname()
'central-hci-0.redhat.local'
>>>
[stack@central-hci-0 ~]$ sudo podman exec -it nova_libvirt virsh hostname
central-hci-0.redhat.local

In this case I'm using pre-deployed hosts where I have explicitly set the hostname to the fqdn using the ansible hostname module.

I expect when using barematal deployment we get the shortname since nova dhcp_domain='' and cloud-init is setting the short hostname. I'll run a quick DNM patch through CI to test setting the correct dhcp_domain. ^H^H^H or not that would need rdo ci to work

Revision history for this message
Takashi Kajinami (kajinamit) wrote :

Hi Oliver,

You are correct and socket.gethostname() can return FQDN.

What I've understand from my tests is that it returns a result consistent with `hostname`
or `uname -n` so it returns not shortname but "a node name".
So the format returned by socket.gethostname() can be any of FQDN or short name
according to the way how node name is determined.

However as far as I know there is no clear restriction about node name format
and this means that node name can be FQDN and short name. Since the selection
has never been enforced it is not "friendly" to assume the users always use
the "expected" format.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/763563
Committed: https://opendev.org/openstack/neutron/commit/ddf0fef28b7095724c8ba27f3275d0dad2252251
Submitter: "Zuul (22348)"
Branch: master

commit ddf0fef28b7095724c8ba27f3275d0dad2252251
Author: Takashi Kajinami <email address hidden>
Date: Fri Nov 20 22:29:19 2020 +0900

    Add a single option to override the default hypervisor name

    Currently neutron uses socket.gethostname() to determine hypervisor
    names, but this implementation is not fully compatible with libvirt
    driver which uses canonical name for hypervisor name.
    This incompatibility causes an issue with root resource provider
    detection if a deployment uses FQDNs as canonicanl names.

    This change introduces the resource_provider_default_hypervisor option,
    so that users can override the hypervisor name by the single option(*1)
    instead of setting two list options(*2). This is especially useful if
    the deployment has multiple bridges or interfaces.

    (*1)
    [OVS]
    resource_provider_bandwidths=br-data1:1024:1024,br-data2:1024:1024,\
    br-data3:1024,1024,br-data4,1024:1024
    resource_provider_default_hypervisor=compute0.mydomain

    (*2)
    [OVS]
    resource_provider_bandwidths=br-data1:1024:1024,br-data2:1024:1024,\
    br-data3:1024,1024,br-data4,1024:1024
    resource_provider_hypervisors=br-data1:compute0.mydomain,br-data2:\
    compute0.mydomain,br-data3:compute0.mydomain,br-data4:compute0.mydomain

    Related-Bug: #1926693
    Change-Id: I692219200535df3af1265248e88c96947e4d8f9d

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/wallaby)

Related fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/796230

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/788893
Committed: https://opendev.org/openstack/neutron/commit/577217c52d677ba35ca78b87c06302d506f66ff9
Submitter: "Zuul (22348)"
Branch: master

commit 577217c52d677ba35ca78b87c06302d506f66ff9
Author: Takashi Kajinami <email address hidden>
Date: Fri Apr 30 15:12:04 2021 +0900

    Make default hypervisor hostname compatible with libvirt

    This change ensures that neutron relies on the same logic as libvirt
    to generate hypervisor hostname, to fix imcompatible hostname format
    used in Nova and Neutron for resource provider name in some
    configuration pattens like the one generated by TripleO.

    Closes-Bug: #1926693
    Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/victoria)

Related fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/796672

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/ussuri)

Related fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/neutron/+/796853

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/train)

Related fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/neutron/+/796836

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/wallaby)

Fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/796854

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/victoria)

Fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/796855

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/ussuri)

Fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/neutron/+/796856

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/train)

Fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/neutron/+/796837

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/796672
Committed: https://opendev.org/openstack/neutron/commit/9c9979612eb07d55a8f1f8515c3abea5327c3ec9
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 9c9979612eb07d55a8f1f8515c3abea5327c3ec9
Author: Takashi Kajinami <email address hidden>
Date: Fri Nov 20 22:29:19 2020 +0900

    Add a single option to override the default hypervisor name

    Currently neutron uses socket.gethostname() to determine hypervisor
    names, but this implementation is not fully compatible with libvirt
    driver which uses canonical name for hypervisor name.
    This incompatibility causes an issue with root resource provider
    detection if a deployment uses FQDNs as canonicanl names.

    This change introduces the resource_provider_default_hypervisor option,
    so that users can override the hypervisor name by the single option(*1)
    instead of setting two list options(*2). This is especially useful if
    the deployment has multiple bridges or interfaces.

    (*1)
    [OVS]
    resource_provider_bandwidths=br-data1:1024:1024,br-data2:1024:1024,\
    br-data3:1024,1024,br-data4,1024:1024
    resource_provider_default_hypervisor=compute0.mydomain

    (*2)
    [OVS]
    resource_provider_bandwidths=br-data1:1024:1024,br-data2:1024:1024,\
    br-data3:1024,1024,br-data4,1024:1024
    resource_provider_hypervisors=br-data1:compute0.mydomain,br-data2:\
    compute0.mydomain,br-data3:compute0.mydomain,br-data4:compute0.mydomain

    Related-Bug: #1926693
    Change-Id: I692219200535df3af1265248e88c96947e4d8f9d
    (cherry picked from commit ddf0fef28b7095724c8ba27f3275d0dad2252251)

tags: added: in-stable-victoria
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/796836
Committed: https://opendev.org/openstack/neutron/commit/83f7b3bdfd9fde1eb2e64f7c321b7020c3ac9fbd
Submitter: "Zuul (22348)"
Branch: stable/train

commit 83f7b3bdfd9fde1eb2e64f7c321b7020c3ac9fbd
Author: Takashi Kajinami <email address hidden>
Date: Fri Nov 20 22:29:19 2020 +0900

    Add a single option to override the default hypervisor name

    Currently neutron uses socket.gethostname() to determine hypervisor
    names, but this implementation is not fully compatible with libvirt
    driver which uses canonical name for hypervisor name.
    This incompatibility causes an issue with root resource provider
    detection if a deployment uses FQDNs as canonicanl names.

    This change introduces the resource_provider_default_hypervisor option,
    so that users can override the hypervisor name by the single option(*1)
    instead of setting two list options(*2). This is especially useful if
    the deployment has multiple bridges or interfaces.

    (*1)
    [OVS]
    resource_provider_bandwidths=br-data1:1024:1024,br-data2:1024:1024,\
    br-data3:1024,1024,br-data4,1024:1024
    resource_provider_default_hypervisor=compute0.mydomain

    (*2)
    [OVS]
    resource_provider_bandwidths=br-data1:1024:1024,br-data2:1024:1024,\
    br-data3:1024,1024,br-data4,1024:1024
    resource_provider_hypervisors=br-data1:compute0.mydomain,br-data2:\
    compute0.mydomain,br-data3:compute0.mydomain,br-data4:compute0.mydomain

    Conflicts:
        neutron/agent/common/utils.py

    Related-Bug: #1926693
    Change-Id: I692219200535df3af1265248e88c96947e4d8f9d
    (cherry picked from commit ddf0fef28b7095724c8ba27f3275d0dad2252251)

tags: added: in-stable-train
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/796230
Committed: https://opendev.org/openstack/neutron/commit/5f57525c9d7bed778fc481019008b312a58e17c4
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit 5f57525c9d7bed778fc481019008b312a58e17c4
Author: Takashi Kajinami <email address hidden>
Date: Fri Nov 20 22:29:19 2020 +0900

    Add a single option to override the default hypervisor name

    Currently neutron uses socket.gethostname() to determine hypervisor
    names, but this implementation is not fully compatible with libvirt
    driver which uses canonical name for hypervisor name.
    This incompatibility causes an issue with root resource provider
    detection if a deployment uses FQDNs as canonicanl names.

    This change introduces the resource_provider_default_hypervisor option,
    so that users can override the hypervisor name by the single option(*1)
    instead of setting two list options(*2). This is especially useful if
    the deployment has multiple bridges or interfaces.

    (*1)
    [OVS]
    resource_provider_bandwidths=br-data1:1024:1024,br-data2:1024:1024,\
    br-data3:1024,1024,br-data4,1024:1024
    resource_provider_default_hypervisor=compute0.mydomain

    (*2)
    [OVS]
    resource_provider_bandwidths=br-data1:1024:1024,br-data2:1024:1024,\
    br-data3:1024,1024,br-data4,1024:1024
    resource_provider_hypervisors=br-data1:compute0.mydomain,br-data2:\
    compute0.mydomain,br-data3:compute0.mydomain,br-data4:compute0.mydomain

    Related-Bug: #1926693
    Change-Id: I692219200535df3af1265248e88c96947e4d8f9d
    (cherry picked from commit ddf0fef28b7095724c8ba27f3275d0dad2252251)

tags: added: in-stable-wallaby
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/796853
Committed: https://opendev.org/openstack/neutron/commit/07a31397ff1d2b435cff9150884c296604f783c7
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit 07a31397ff1d2b435cff9150884c296604f783c7
Author: Takashi Kajinami <email address hidden>
Date: Fri Nov 20 22:29:19 2020 +0900

    Add a single option to override the default hypervisor name

    Currently neutron uses socket.gethostname() to determine hypervisor
    names, but this implementation is not fully compatible with libvirt
    driver which uses canonical name for hypervisor name.
    This incompatibility causes an issue with root resource provider
    detection if a deployment uses FQDNs as canonicanl names.

    This change introduces the resource_provider_default_hypervisor option,
    so that users can override the hypervisor name by the single option(*1)
    instead of setting two list options(*2). This is especially useful if
    the deployment has multiple bridges or interfaces.

    (*1)
    [OVS]
    resource_provider_bandwidths=br-data1:1024:1024,br-data2:1024:1024,\
    br-data3:1024,1024,br-data4,1024:1024
    resource_provider_default_hypervisor=compute0.mydomain

    (*2)
    [OVS]
    resource_provider_bandwidths=br-data1:1024:1024,br-data2:1024:1024,\
    br-data3:1024,1024,br-data4,1024:1024
    resource_provider_hypervisors=br-data1:compute0.mydomain,br-data2:\
    compute0.mydomain,br-data3:compute0.mydomain,br-data4:compute0.mydomain

    Related-Bug: #1926693
    Change-Id: I692219200535df3af1265248e88c96947e4d8f9d
    (cherry picked from commit ddf0fef28b7095724c8ba27f3275d0dad2252251)

tags: added: in-stable-ussuri
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/796854
Committed: https://opendev.org/openstack/neutron/commit/b0c487f711ab7d4a1ec615ea2f0e94614cbbf8da
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit b0c487f711ab7d4a1ec615ea2f0e94614cbbf8da
Author: Takashi Kajinami <email address hidden>
Date: Fri Apr 30 15:12:04 2021 +0900

    Make default hypervisor hostname compatible with libvirt

    This change ensures that neutron relies on the same logic as libvirt
    to generate hypervisor hostname, to fix imcompatible hostname format
    used in Nova and Neutron for resource provider name in some
    configuration pattens like the one generated by TripleO.

    Closes-Bug: #1926693
    Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1
    (cherry picked from commit 577217c52d677ba35ca78b87c06302d506f66ff9)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/796855
Committed: https://opendev.org/openstack/neutron/commit/1ee664f65bc650775713c7adcaf983e48c12dbec
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit 1ee664f65bc650775713c7adcaf983e48c12dbec
Author: Takashi Kajinami <email address hidden>
Date: Fri Apr 30 15:12:04 2021 +0900

    Make default hypervisor hostname compatible with libvirt

    This change ensures that neutron relies on the same logic as libvirt
    to generate hypervisor hostname, to fix imcompatible hostname format
    used in Nova and Neutron for resource provider name in some
    configuration pattens like the one generated by TripleO.

    Closes-Bug: #1926693
    Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1
    (cherry picked from commit 577217c52d677ba35ca78b87c06302d506f66ff9)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/796856
Committed: https://opendev.org/openstack/neutron/commit/aa8f6ff547b132a2b85d7da561fa3444de5f8254
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit aa8f6ff547b132a2b85d7da561fa3444de5f8254
Author: Takashi Kajinami <email address hidden>
Date: Fri Apr 30 15:12:04 2021 +0900

    Make default hypervisor hostname compatible with libvirt

    This change ensures that neutron relies on the same logic as libvirt
    to generate hypervisor hostname, to fix imcompatible hostname format
    used in Nova and Neutron for resource provider name in some
    configuration pattens like the one generated by TripleO.

    Closes-Bug: #1926693
    Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1
    (cherry picked from commit 577217c52d677ba35ca78b87c06302d506f66ff9)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/796837
Committed: https://opendev.org/openstack/neutron/commit/d9d884f783417795a05ca8a1c2bf64c9b55b6370
Submitter: "Zuul (22348)"
Branch: stable/train

commit d9d884f783417795a05ca8a1c2bf64c9b55b6370
Author: Takashi Kajinami <email address hidden>
Date: Fri Apr 30 15:12:04 2021 +0900

    Make default hypervisor hostname compatible with libvirt

    This change ensures that neutron relies on the same logic as libvirt
    to generate hypervisor hostname, to fix imcompatible hostname format
    used in Nova and Neutron for resource provider name in some
    configuration pattens like the one generated by TripleO.

    Conflicts:
        neutron/agent/common/utils.py
        neutron/tests/unit/agent/common/test_utils.py

    Closes-Bug: #1926693
    Change-Id: Iea2533f4c52935b4ecda9ec22fb619c131febfa1
    (cherry picked from commit 577217c52d677ba35ca78b87c06302d506f66ff9)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 16.4.0

This issue was fixed in the openstack/neutron 16.4.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 17.2.0

This issue was fixed in the openstack/neutron 17.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 18.1.0

This issue was fixed in the openstack/neutron 18.1.0 release.

tags: added: neutron-proactive-backport-potential
tags: removed: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 19.0.0.0rc1

This issue was fixed in the openstack/neutron 19.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/neutron/+/849122

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/849122
Committed: https://opendev.org/openstack/neutron/commit/ea223072841adc3fb88b840b5f8018bff60c8aa7
Submitter: "Zuul (22348)"
Branch: master

commit ea223072841adc3fb88b840b5f8018bff60c8aa7
Author: Miro Tomaska <email address hidden>
Date: Fri Jul 8 09:56:23 2022 -0500

    Add workaround for eventlet.greendns bug

    Issue[1] workaround: A wrapper class which determines if socket module
    was eventlet patched and request std lib socket module instead.
    Also adding LOG.warning into the exception block so we dont miss
    issues like this in the future.

    Closes-Bug: #1980967
    Related-Bug: #1926693

    [1]https://github.com/eventlet/eventlet/issues/764

    Change-Id: I41c4cbc1aaea95f7808e6c6dca47ecd0402351c9

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/yoga)

Related fix proposed to branch: stable/yoga
Review: https://review.opendev.org/c/openstack/neutron/+/851532

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/xena)

Related fix proposed to branch: stable/xena
Review: https://review.opendev.org/c/openstack/neutron/+/851533

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/wallaby)

Related fix proposed to branch: stable/wallaby
Review: https://review.opendev.org/c/openstack/neutron/+/851534

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/victoria)

Related fix proposed to branch: stable/victoria
Review: https://review.opendev.org/c/openstack/neutron/+/851535

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/ussuri)

Related fix proposed to branch: stable/ussuri
Review: https://review.opendev.org/c/openstack/neutron/+/851536

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (stable/train)

Related fix proposed to branch: stable/train
Review: https://review.opendev.org/c/openstack/neutron/+/851537

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/yoga)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/851532
Committed: https://opendev.org/openstack/neutron/commit/363f0a972e7821740a8ffb1e85b97ba001cff77c
Submitter: "Zuul (22348)"
Branch: stable/yoga

commit 363f0a972e7821740a8ffb1e85b97ba001cff77c
Author: Miro Tomaska <email address hidden>
Date: Fri Jul 8 09:56:23 2022 -0500

    Add workaround for eventlet.greendns bug

    Issue[1] workaround: A wrapper class which determines if socket module
    was eventlet patched and request std lib socket module instead.
    Also adding LOG.warning into the exception block so we dont miss
    issues like this in the future.

    Closes-Bug: #1980967
    Related-Bug: #1926693

    [1]https://github.com/eventlet/eventlet/issues/764

    Change-Id: I41c4cbc1aaea95f7808e6c6dca47ecd0402351c9
    (cherry picked from commit ea223072841adc3fb88b840b5f8018bff60c8aa7)

tags: added: in-stable-yoga
tags: added: in-stable-xena
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/xena)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/851533
Committed: https://opendev.org/openstack/neutron/commit/ec831cdf124dff1a15b1a64ff3992a822348bc50
Submitter: "Zuul (22348)"
Branch: stable/xena

commit ec831cdf124dff1a15b1a64ff3992a822348bc50
Author: Miro Tomaska <email address hidden>
Date: Fri Jul 8 09:56:23 2022 -0500

    Add workaround for eventlet.greendns bug

    Issue[1] workaround: A wrapper class which determines if socket module
    was eventlet patched and request std lib socket module instead.
    Also adding LOG.warning into the exception block so we dont miss
    issues like this in the future.

    Closes-Bug: #1980967
    Related-Bug: #1926693

    [1]https://github.com/eventlet/eventlet/issues/764

    Change-Id: I41c4cbc1aaea95f7808e6c6dca47ecd0402351c9
    (cherry picked from commit ea223072841adc3fb88b840b5f8018bff60c8aa7)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/wallaby)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/851534
Committed: https://opendev.org/openstack/neutron/commit/b9fb76e57fe072daeff1997c69e9907eeaffec94
Submitter: "Zuul (22348)"
Branch: stable/wallaby

commit b9fb76e57fe072daeff1997c69e9907eeaffec94
Author: Miro Tomaska <email address hidden>
Date: Fri Jul 8 09:56:23 2022 -0500

    Add workaround for eventlet.greendns bug

    Issue[1] workaround: A wrapper class which determines if socket module
    was eventlet patched and request std lib socket module instead.
    Also adding LOG.warning into the exception block so we dont miss
    issues like this in the future.

    Closes-Bug: #1980967
    Related-Bug: #1926693

    [1]https://github.com/eventlet/eventlet/issues/764

    Change-Id: I41c4cbc1aaea95f7808e6c6dca47ecd0402351c9
    (cherry picked from commit ea223072841adc3fb88b840b5f8018bff60c8aa7)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/victoria)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/851535
Committed: https://opendev.org/openstack/neutron/commit/f3f28b32337e0419dd43118608a6ab959f99bdeb
Submitter: "Zuul (22348)"
Branch: stable/victoria

commit f3f28b32337e0419dd43118608a6ab959f99bdeb
Author: Miro Tomaska <email address hidden>
Date: Fri Jul 8 09:56:23 2022 -0500

    Add workaround for eventlet.greendns bug

    Issue[1] workaround: A wrapper class which determines if socket module
    was eventlet patched and request std lib socket module instead.
    Also adding LOG.warning into the exception block so we dont miss
    issues like this in the future.

    Closes-Bug: #1980967
    Related-Bug: #1926693

    [1]https://github.com/eventlet/eventlet/issues/764

    Change-Id: I41c4cbc1aaea95f7808e6c6dca47ecd0402351c9
    (cherry picked from commit ea223072841adc3fb88b840b5f8018bff60c8aa7)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/ussuri)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/851536
Committed: https://opendev.org/openstack/neutron/commit/8efb736df12b0b0d349f597bd124b0cbad96be00
Submitter: "Zuul (22348)"
Branch: stable/ussuri

commit 8efb736df12b0b0d349f597bd124b0cbad96be00
Author: Miro Tomaska <email address hidden>
Date: Fri Jul 8 09:56:23 2022 -0500

    Add workaround for eventlet.greendns bug

    Issue[1] workaround: A wrapper class which determines if socket module
    was eventlet patched and request std lib socket module instead.
    Also adding LOG.warning into the exception block so we dont miss
    issues like this in the future.

    Closes-Bug: #1980967
    Related-Bug: #1926693

    [1]https://github.com/eventlet/eventlet/issues/764

    Change-Id: I41c4cbc1aaea95f7808e6c6dca47ecd0402351c9
    (cherry picked from commit ea223072841adc3fb88b840b5f8018bff60c8aa7)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (stable/train)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/851537
Committed: https://opendev.org/openstack/neutron/commit/6c8c1cca4e1be43b1e5a86d7d72c6581e1bd76dd
Submitter: "Zuul (22348)"
Branch: stable/train

commit 6c8c1cca4e1be43b1e5a86d7d72c6581e1bd76dd
Author: Miro Tomaska <email address hidden>
Date: Fri Jul 8 09:56:23 2022 -0500

    Add workaround for eventlet.greendns bug

    Issue[1] workaround: A wrapper class which determines if socket module
    was eventlet patched and request std lib socket module instead.
    Also adding LOG.warning into the exception block so we dont miss
    issues like this in the future.

    Closes-Bug: #1980967
    Related-Bug: #1926693

    [1]https://github.com/eventlet/eventlet/issues/764

    Conflicts:
            neutron/agent/common/utils.py
    Conflict is due to socket.gaierror being a separate exception until
    python 3.3. After 3.3 it was subclassed under OSError. Train needs
    to support python2.7

    NOTE: I also had to change getaddrinfo arguments to positional args
    as py27 implementation does not support keyword args.

    Change-Id: I41c4cbc1aaea95f7808e6c6dca47ecd0402351c9
    (cherry picked from commit ea223072841adc3fb88b840b5f8018bff60c8aa7)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron train-eol

This issue was fixed in the openstack/neutron train-eol release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.