Exception when using database pooling

Bug #1157045 reported by Gary Kotton
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Gary Kotton

Bug Description

When sql_dbpool_enable is set a True we get the following exception:

2013-03-17 11:24:27 ERROR [quantum.openstack.common.rpc.amqp] Exception during message handling
Traceback (most recent call last):
  File "/opt/stack/quantum/quantum/openstack/common/rpc/amqp.py", line 430, in _process_data
    rval = self.proxy.dispatch(ctxt, version, method, **args)
  File "/opt/stack/quantum/quantum/common/rpc.py", line 43, in dispatch
    quantum_ctxt, version, method, **kwargs)
  File "/opt/stack/quantum/quantum/openstack/common/rpc/dispatcher.py", line 133, in dispatch
    return getattr(proxyobj, method)(ctxt, **kwargs)
  File "/opt/stack/quantum/quantum/db/agents_db.py", line 167, in report_state
    plugin.create_or_update_agent(context, agent_state)
  File "/opt/stack/quantum/quantum/db/agents_db.py", line 156, in create_or_update_agent
    context.session.add(agent_db)
  File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 452, in __exit__
    raise
TypeError: exceptions must be old-style classes or derived from BaseException, not NoneType

In OSLO there was the following task removing this support https://github.com/openstack/oslo-incubator/commit/02c12aade7a0c28c66cb45b54786c90c0ae8fb09

Tags: db
Gary Kotton (garyk)
Changed in quantum:
milestone: none → havana-1
assignee: nobody → Gary Kotton (garyk)
importance: Undecided → High
Gary Kotton (garyk)
tags: added: grizzly-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

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

Changed in quantum:
status: New → In Progress
tags: added: db
Revision history for this message
Mark McClain (markmcclain) wrote :

This error is actually masking the real error:

StaleDataError("UPDATE statement on table 'agents' expected to update 1 row(s); 0 were matched.",)

Revision history for this message
Mark McClain (markmcclain) wrote :

This link gives a little more idea how the error is masked:

http://stackoverflow.com/questions/9525220/sqlalchemy-raises-none-causes-typeerror

Revision history for this message
dan wendlandt (danwent) wrote :

it seems like when OSLO removed support for dbpool, they added support for another mechanism to do connection pooling: https://github.com/openstack/oslo-incubator/commit/02c12aade7a0c28c66cb45b54786c90c0ae8fb09

The proposed patch only removes support, which but doesn't given another option for db-pooling. It seems like from salvatore's comment on the patch, if we don't have pooling, we expect it will uncover other issues, is that correct?

If so, my feeling would be to see if there is a better way we can deal with the individual source of the underlying exception, which is masked by the exception posted above. Or do we think we will just end up facing this in many different places in the code base?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/25024
Committed: http://github.com/openstack/quantum/commit/7f21283ef36eadd5e600f08e5572580f11d06a7c
Submitter: Jenkins
Branch: master

commit 7f21283ef36eadd5e600f08e5572580f11d06a7c
Author: Gary Kotton <email address hidden>
Date: Thu Mar 21 17:01:31 2013 +0000

    Fix issues with db pooling

    Fixes bug 1157045

    In addition to this a cast is used instead of a call for the
    report update.

    Change-Id: I1b0ea5b18b3d75dc3d047975b234275420af189c

Changed in quantum:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/25109

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (milestone-proposed)

Reviewed: https://review.openstack.org/25109
Committed: http://github.com/openstack/quantum/commit/1ee37e03a6d722d516ebeeab6cbad3d4ddca3eba
Submitter: Jenkins
Branch: milestone-proposed

commit 1ee37e03a6d722d516ebeeab6cbad3d4ddca3eba
Author: Gary Kotton <email address hidden>
Date: Thu Mar 21 17:01:31 2013 +0000

    Fix issues with db pooling

    Fixes bug 1157045

    Change-Id: I1b0ea5b18b3d75dc3d047975b234275420af189c

Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-1 → 2013.2
Alan Pevec (apevec)
tags: removed: grizzly-backport-potential
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.