Memcache pool locks on release

Bug #1401108 reported by Alexander Makarov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Alexander Makarov

Bug Description

At some point Keystone stops processing HTTP requests and HAProxy moves the server out of pool. Once Keystones on all controllers stuck HAProxy starts to respond with HTTP 503 error.

Symptoms:
~~~~~~~~~
HAProxy log:
2014-12-08T11:01:06.135849+00:00 info: 192.168.0.23:34984 [08/Dec/2014:11:01:06.135] keystone-2 keystone-2/<NOSRV> 0/-1/-1/-1/0 503 212 - - SC-- 366/0/0/0/0 0/0 "POST /v2.0/tokens HTTP/1.1"

Keystone keeps accepting TCP connection, but hangs at HTTP level (meaning that telnet works, but curl hangs)

root@node-21:/var/log/keystone# strace -p 26330
Process 26330 attached - interrupt to quit
futex(0xe50420, FUTEX_WAIT_PRIVATE, 0, NULL

The last logged message from stuck process:
2014-12-05 17:01:20.749 26330 DEBUG keystone.common.cache._memcache_pool [-] Memcached pool 39391504, thread 139781728069376: Acquiring connection _debug_logger /usr/lib/python2.7/dist-packages/keystone/common/cache/_memcache_pool.py:91

Memcache pool has asymmetric behaviour on aquire and release of a connection:
If pool is depleted a new connection is created
If pool has reached it's maximum size that connection excess still being pushed back to the pool causing thread lock.

Changed in keystone:
assignee: nobody → Alexander Makarov (amakarov)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

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

Reviewed: https://review.openstack.org/140681
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=66b37af4728d6eab29632c95e3d7e406990359fd
Submitter: Jenkins
Branch: master

commit 66b37af4728d6eab29632c95e3d7e406990359fd
Author: Alexander Makarov <email address hidden>
Date: Mon Dec 8 20:51:02 2014 +0300

    Memcache connection pool excess check

    When memcache pool depletes exceeding connections are created.
    Then they are pushed back the to pool via a blocking operation ``put``.
    As a result thread, attempting to release connection, blocks.

    This patch adds a check preventing pushung the excess back to the pool,
    closing released connection instead.

    Change-Id: I17756fb5f27cb6a950c647590e2a9e0a83c336ca
    Closes-Bug: #1401108
    Closes-Bug: #1400326

Changed in keystone:
status: In Progress → Fix Committed
Changed in keystone:
importance: Undecided → Medium
milestone: none → kilo-2
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: kilo-2 → 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.