DetachedInstanceError when binding network to agent

Bug #1424578 reported by Eugene Nikanorov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Eugene Nikanorov

Bug Description

TRACE neutron.db.agentschedulers_db Traceback (most recent call last):
TRACE neutron.db.agentschedulers_db File "/usr/lib/python2.7/dist-packages/neutron/db/agentschedulers_db.py", line 192, in _schedule_network
TRACE neutron.db.agentschedulers_db agents = self.schedule_network(context, network)
TRACE neutron.db.agentschedulers_db File "/usr/lib/python2.7/dist-packages/neutron/db/agentschedulers_db.py", line 400, in schedule_network
TRACE neutron.db.agentschedulers_db self, context, created_network)
TRACE neutron.db.agentschedulers_db File "/usr/lib/python2.7/dist-packages/neutron/scheduler/dhcp_agent_scheduler.py", line 91, in schedule
TRACE neutron.db.agentschedulers_db self._schedule_bind_network(context, chosen_agents, network['id'])
TRACE neutron.db.agentschedulers_db File "/usr/lib/python2.7/dist-packages/neutron/scheduler/dhcp_agent_scheduler.py", line 51, in _schedule_bind_network
TRACE neutron.db.agentschedulers_db LOG.info(_('Agent %s already present'), agent)
...
TRACE neutron.db.agentschedulers_db DetachedInstanceError: Instance <Agent at 0x5ff1710> is not bound to a Session; attribute refresh operation cannot proceed
2015-02-21 14:45:15.927 1417 TRACE neutron.db.agentschedulers_db

Need to print saved agent_id instead of using db object.

Revision history for this message
Eugene Nikanorov (enikanorov) wrote :

Apparently this is only reproducible under mysql. There is a unit test for exact conditions that lead to this trace, but no such exception is thrown.

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

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

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/158242
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=4d4de151e9a0edd86b8ce5b055e56a5784d5c08f
Submitter: Jenkins
Branch: master

commit 4d4de151e9a0edd86b8ce5b055e56a5784d5c08f
Author: Eugene Nikanorov <email address hidden>
Date: Mon Feb 23 13:29:08 2015 +0300

    Avoid DetachedInstanceError after session rollback

    In some cases this exception is thrown while accessing Agent
    object from logging statement after a transaction was rolled back.
    There is a unit test that covers thsi code patch, but the issue
    is not reproducible with sqlite.
    Just avoid accessing db object after session had been closed.

    Change-Id: Iff6b72156b08f177bd0c71f6ba93d3bf46c82fa4
    Closes-Bug: #1424578

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: kilo-3 → 2015.1.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.