← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1573949] Re: lbaas: better to close a socket explicitly rather than implicitly when they are garbage-collected

 

This is being reported against an lbaas v1 driver, which is deprecated
and pending removal in Newton. If you want to submit a code change, a
reviewer might look at it, but we're not accepting bugs/blueprints/specs
for lbaas v1.

** Changed in: neutron
       Status: New => Won't Fix

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1573949

Title:
  lbaas: better to close a socket explicitly rather than implicitly when
  they are garbage-collected

Status in neutron:
  Won't Fix

Bug description:
  https://github.com/openstack/neutron-
  lbaas/blob/master/neutron_lbaas/services/loadbalancer/drivers/haproxy/namespace_driver.py#L205
  :

      def _get_stats_from_socket(self, socket_path, entity_type):
          try:
              s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
              s.connect(socket_path)
              s.send('show stat -1 %s -1\n' % entity_type)
              raw_stats = ''
              chunk_size = 1024
              while True:
                  chunk = s.recv(chunk_size)
                  raw_stats += chunk
                  if len(chunk) < chunk_size:
                      break

              return self._parse_stats(raw_stats)
          except socket.error as e:
              LOG.warning(_LW('Error while connecting to stats socket: %s'), e)
              return {}

  in this function, a socket connection is created but it is not closed
  explicitly. It is better to close it when all things have been done

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1573949/+subscriptions


References