Comment 65 for bug 1593456

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/horizon (mcp/ocata)

Reviewed: https://review.fuel-infra.org/34808
Submitter: Pkgs Jenkins <email address hidden>
Branch: mcp/ocata

Commit: 7d03f243c68c9c1052bcb8f7dba17f240e930b4d
Author: Timur Sufiev <email address hidden>
Date: Wed Apr 26 16:22:51 2017

Make @memoize thread-aware

If 2 parallel threads simultaneously make an expensive call to a
memoized function with arguments for which the returned value wasn's
cached before, 2 calls are effectively made in parallel.

It's better to avoid such a situation and if one thread already
initiated an expensive call, block on it in another thread and once
the call in the first thread is completed, unblock and reuse the value
which is cached now.

Partial-Bug: #1593456
Change-Id: I99c6d4eac5cce7bdc9ad059d1d08d2f457e7f492