← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1458718] [NEW] DB2 error occurs when neutron server enables multiple api works

 

Public bug reported:

When neutron server enables multiple api workers, it will use os.fork
to start multiple neutron server process.  During this period, some DB2
error will occur as below, which shows we are trying to close a closed
connection.  It seems like that pooled connection is shared by
processes.

2015-04-29 22:27:39.330 567 ERROR sqlalchemy.pool.QueuePool [-] Exception closing connection <ibm_db_dbi.Connection object at 0x469a190>
2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool Traceback (most recent call last):
2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool   File "/usr/lib64/python2.7/site-packages/sqlalchemy/pool.py", line 250, in _close_connection
2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool     self._dialect.do_close(connection)
2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 412, in do_close
2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool     dbapi_connection.close()
2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool   File "/usr/lib64/python2.7/site-packages/ibm_db_dbi.py", line 688, in close
2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool     raise _get_exception(inst)
2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool OperationalError: ibm_db_dbi::OperationalError: [IBM][CLI Driver] CLI0106E  Connection is closed. SQLSTATE=08003 SQLCODE=-99999


Currently neutron is using dispose() in child process to release the connnection and create new one. Actually we should close connection is father process before os.fork and create a separate engine for each child process. 

Reference to sqlalchemy
doc(http://docs.sqlalchemy.org/en/latest/core/connections.html#basic-
usage)

** Affects: neutron
     Importance: Undecided
     Assignee: Zhang Gong (zhanggbj)
         Status: New

** Changed in: neutron
     Assignee: (unassigned) => Zhang Gong (zhanggbj)

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

Title:
  DB2 error occurs when neutron server enables multiple api works

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  When neutron server enables multiple api workers, it will use os.fork
  to start multiple neutron server process.  During this period, some
  DB2 error will occur as below, which shows we are trying to close a
  closed connection.  It seems like that pooled connection is shared by
  processes.

  2015-04-29 22:27:39.330 567 ERROR sqlalchemy.pool.QueuePool [-] Exception closing connection <ibm_db_dbi.Connection object at 0x469a190>
  2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool Traceback (most recent call last):
  2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool   File "/usr/lib64/python2.7/site-packages/sqlalchemy/pool.py", line 250, in _close_connection
  2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool     self._dialect.do_close(connection)
  2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 412, in do_close
  2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool     dbapi_connection.close()
  2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool   File "/usr/lib64/python2.7/site-packages/ibm_db_dbi.py", line 688, in close
  2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool     raise _get_exception(inst)
  2015-04-29 22:27:39.330 567 TRACE sqlalchemy.pool.QueuePool OperationalError: ibm_db_dbi::OperationalError: [IBM][CLI Driver] CLI0106E  Connection is closed. SQLSTATE=08003 SQLCODE=-99999

  
  Currently neutron is using dispose() in child process to release the connnection and create new one. Actually we should close connection is father process before os.fork and create a separate engine for each child process. 

  Reference to sqlalchemy
  doc(http://docs.sqlalchemy.org/en/latest/core/connections.html#basic-
  usage)

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


Follow ups

References