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

Bug #1374497 reported by Mike Bayer on 2014-09-26
34
This bug affects 10 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Medium
Unassigned
oslo.db
High
Mike Bayer
Juno
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 Edit Tag help
Mike Bayer (zzzeek) on 2014-09-26
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
Changed in oslo.db:
status: Triaged → In Progress
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) on 2014-09-30
no longer affects: oslo.db/juno
Changed in oslo.db:
status: In Progress → Fix Committed
Dolph Mathews (dolph) on 2014-10-02
tags: added: juno-rc-potential
tags: removed: juno-rc-potential
Changed in oslo.db:
status: Fix Committed → Fix Released
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
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  Edit
Everyone can see this information.

Other bug subscribers