change in oslo.db "ping" handling is causing issues in projects that are not using transactions

Bug #1374497 reported by Mike Bayer
34
This bug affects 10 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Won't Fix
Medium
Unassigned
oslo.db
Fix Released
High
Mike Bayer
Juno
Fix Released
High
Mike Bayer

Bug Description

in https://review.openstack.org/#/c/106491/, the "ping" listener which emits "SELECT 1" at connection start was moved from being a connection pool "checkout" handler to a "transaction on begin" handler. Apparently Keystone and possibly others are using the Session in "autocommit" mode, despite that this is explicitly warned against in SQLAlchemy's docs (see http://docs.sqlalchemy.org/en/rel_0_9/orm/session.html#autocommit-mode), and for these projects they are seeing failed connections not transparently recovered (see https://bugs.launchpad.net/keystone/+bug/1361378).

Alternatives include:

1. move the ping listener back to being a "checkout" handler

2. fix downstream projects to not use the session in autocommit mode

In all likelihood, the fix here should involve both. I have a longer term plan to fix EngineFacade once and for all so that the correct use patterns are explicit, but that still has to be blueprinted.

Tags: sql
Mike Bayer (zzzeek)
Changed in oslo.db:
assignee: nobody → Mike Bayer (zzzeek)
Changed in oslo.db:
status: New → Triaged
importance: Undecided → High
Changed in oslo.db:
milestone: none → next-kilo
Revision history for this message
Mike Bayer (zzzeek) wrote :
Changed in oslo.db:
status: Triaged → In Progress
Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

The cleanup to not use session with autocommit will be a fix we apply to Keystone in Kilo (it is something we should do regardless). I talked with Doug Hellmann and Mike Bayer and they agreed the more immidiate fix should go into oslo.db for the Juno timeframe.

As such I've targeted this to K1 (might slip to a later K-milestone as we go) but should be resolved in Kilo release cycle.

Changed in keystone:
milestone: none → kilo-1
status: New → Confirmed
importance: Undecided → Medium
status: Confirmed → Triaged
Thierry Carrez (ttx)
no longer affects: oslo.db/juno
Changed in oslo.db:
status: In Progress → Fix Committed
Revision history for this message
Doug Hellmann (doug-hellmann) wrote :
Dolph Mathews (dolph)
tags: added: juno-rc-potential
tags: removed: juno-rc-potential
Changed in oslo.db:
status: Fix Committed → Fix Released
Revision history for this message
Morgan Fainberg (mdrnstm) wrote :

Moved from K1 as we'll pick this up when EngineFacade is refactored. The fix to olso.db should be sufficient for handling our current use-cases.

Changed in keystone:
milestone: kilo-1 → none
tags: added: sql
Revision history for this message
Brant Knudson (blk-u) wrote :

There's a fix in oslo.db. The work to update Keystone will be part of a spec or blueprint to use new features in oslo.db once they're ready. I don't think it's worth keeping a bug open.

Changed in keystone:
status: Triaged → Won't Fix
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.