i386 tests exhaust threads

Bug #1586443 reported by Corey Bryant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gnocchi
Fix Released
Medium
Julien Danjou
2.1
Fix Released
Medium
Julien Danjou

Bug Description

I was trying to backport gnocchi to the trusty-mitaka ubuntu cloud archive (which builds the package on i386 only). Tests are executed as part of the package build. After several tests have run successfully (~1300), the remaining 222 tests fail with the the same "thread.error: can't start new thread" failure. For example:

======================================================================
FAIL: gnocchi.tests.test_rest.ResourceTest.test_post_resource_with_invalid_metric(keystone,image_none_user)
gnocchi.tests.test_rest.ResourceTest.test_post_resource_with_invalid_metric(keystone,image_none_user)
----------------------------------------------------------------------
_StringException: Empty attachments:
  stderr
  stdout

Traceback (most recent call last):
  File "gnocchi/tests/base.py", line 53, in skip_if_not_implemented
    return func(*args, **kwargs)
  File "gnocchi/tests/test_rest.py", line 766, in setUp
    super(ResourceTest, self).setUp()
  File "gnocchi/tests/base.py", line 53, in skip_if_not_implemented
    return func(*args, **kwargs)
  File "gnocchi/tests/test_rest.py", line 102, in setUp
    super(RestTest, self).setUp()
  File "gnocchi/tests/base.py", line 53, in skip_if_not_implemented
    return func(*args, **kwargs)
  File "gnocchi/tests/base.py", line 420, in setUp
    self.storage = storage.get_driver(self.conf)
  File "gnocchi/storage/__init__.py", line 155, in get_driver
    return get_driver_class(conf)(conf.storage)
  File "gnocchi/storage/file.py", line 44, in __init__
    super(FileStorage, self).__init__(conf)
  File "gnocchi/storage/_carbonara.py", line 69, in __init__
    self.heartbeater.start()
  File "/usr/lib/python2.7/threading.py", line 745, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

Carbonara appears to be running out of threads. trusty python packages build on i386 only whereas xenial are on amd64, so that may be why this only surfaces on i386 for us.

description: updated
Revision history for this message
Julien Danjou (jdanjou) wrote :

Makes sense, the heartbeater thread is never stopped. We need to implement a stop() can call it.

Changed in gnocchi:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to gnocchi (master)

Fix proposed to branch: master
Review: https://review.openstack.org/322726

Changed in gnocchi:
assignee: nobody → Julien Danjou (jdanjou)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to gnocchi (stable/2.1)

Fix proposed to branch: stable/2.1
Review: https://review.openstack.org/323184

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

Reviewed: https://review.openstack.org/322726
Committed: https://git.openstack.org/cgit/openstack/gnocchi/commit/?id=4934c2b8c1b9cb4f8fb4fd48f0cca61c95318734
Submitter: Jenkins
Branch: master

commit 4934c2b8c1b9cb4f8fb4fd48f0cca61c95318734
Author: Julien Danjou <email address hidden>
Date: Mon May 30 11:16:58 2016 +0200

    _carbonara: stop heartbeat thread on stop()

    Change-Id: Ie79f6dd5ff7a11e964fdf049ccfdc642cef89e5a
    Closes-Bug: #1586443

Changed in gnocchi:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to gnocchi (stable/2.1)

Reviewed: https://review.openstack.org/323184
Committed: https://git.openstack.org/cgit/openstack/gnocchi/commit/?id=e35ee8480873cb4a36d06db31d05af72e3da1a68
Submitter: Jenkins
Branch: stable/2.1

commit e35ee8480873cb4a36d06db31d05af72e3da1a68
Author: Julien Danjou <email address hidden>
Date: Mon May 30 11:16:58 2016 +0200

    _carbonara: stop heartbeat thread on stop()

    Change-Id: Ie79f6dd5ff7a11e964fdf049ccfdc642cef89e5a
    Closes-Bug: #1586443

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/gnocchi 2.2.0

This issue was fixed in the openstack/gnocchi 2.2.0 release.

Julien Danjou (jdanjou)
Changed in gnocchi:
status: Fix Committed → Fix Released
milestone: none → 2.2.0
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.