snmp pollster is not thread safe

Bug #1576577 reported by Mehdi Abaakouk
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
Mehdi Abaakouk

Bug Description

Hi,

the snmp pollster uses pysnmp, more precisely oneliner.CommandGenerator() object.

This one is not threads safe. Currently we use one object for all query within a process.

On juno, this was resulting to the following backtrace because on eventlet:

;RuntimeError: Second simultaneous write on fileno 21 detected. Unless you really know what you're doing, make sure that only one greenthread can write any particular socket. Consider using a pools.Pool. If yo
u do know what you're doing and want to disable this error, call eventlet.debug.hub_prevent_multiple_readers(False) - MY THREAD=<built-in method switch of GreenThread object at 0x2da5050>; THAT THREAD=FdListener
('write', 21, <built-in method switch of GreenThread object at 0x2da50f0>, <built-in method throw of GreenThread object at 0x2da50f0>)
2015-11-19 08:08:48.844 25809 ERROR ceilometer.hardware.pollsters.generic Traceback (most recent call last):

Now the issue is completely hidden because nothing warn us when we write with two threads into the same socket.

Cheers,

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

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

Changed in ceilometer:
assignee: nobody → Mehdi Abaakouk (sileht)
status: New → In Progress
ZhiQiang Fan (aji-zqfan)
Changed in ceilometer:
importance: Undecided → High
Revision history for this message
ZhiQiang Fan (aji-zqfan) wrote :

please submit changes to stable branch, master branch doesn't have such issue IIUC

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

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/311087

Revision history for this message
Mehdi Abaakouk (sileht) wrote :

Complete backtrace on a liberty installation: https://bugzilla.redhat.com/attachment.cgi?id=1096715

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

Reviewed: https://review.openstack.org/311057
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=c898ecd921123eab61a8f88e61686ab4edf82b35
Submitter: Jenkins
Branch: master

commit c898ecd921123eab61a8f88e61686ab4edf82b35
Author: Mehdi Abaakouk <email address hidden>
Date: Fri Apr 29 10:30:13 2016 +0200

    Fix concurrency issue with snmp pollsters

    pysnmp oneliner.CommandGenerator() is not thread safe.

    This change creates one oneliner.CommandGenerator() per query to fix
    the issue.

    Closes-bug: #1576577

    Change-Id: Ibf32c068abed5d7198150bc206987f050a093cd8

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

Reviewed: https://review.openstack.org/311087
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=fe66169a2e1f774617f60cc5902d84b110efafec
Submitter: Jenkins
Branch: stable/liberty

commit fe66169a2e1f774617f60cc5902d84b110efafec
Author: Mehdi Abaakouk <email address hidden>
Date: Fri Apr 29 10:30:13 2016 +0200

    Fix concurrency issue with snmp pollsters

    pysnmp oneliner.CommandGenerator() is not thread safe.

    This change creates one oneliner.CommandGenerator() per query to fix
    the issue.

    Closes-bug: #1576577

    Change-Id: Ibf32c068abed5d7198150bc206987f050a093cd8
    (cherry picked from commit c898ecd921123eab61a8f88e61686ab4edf82b35)

tags: added: in-stable-liberty
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/ceilometer 5.0.4

This issue was fixed in the openstack/ceilometer 5.0.4 release.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/ceilometer 7.0.0.0b2

This issue was fixed in the openstack/ceilometer 7.0.0.0b2 development milestone.

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.