NSXv3: Race condition fix for cert provider
Refcount initialization needs to be under lock Change-Id: I27ee0161bfe2357c1c7acfb34ac58af30541cf8d
This commit is contained in:
parent
7832618c43
commit
83a6e7fc06
|
@ -54,7 +54,11 @@ class DbCertProvider(client_cert.ClientCertProvider):
|
|||
# Such collisions are handled with refcount and locking.
|
||||
super(DbCertProvider, self).__init__(None)
|
||||
random.seed()
|
||||
self.refcount = 0
|
||||
|
||||
with self.lock:
|
||||
# Initialize refcount if other threads did not do it already
|
||||
if not hasattr(self, 'refcount'):
|
||||
self.refcount = 0
|
||||
|
||||
def _check_expiration(self, expires_in_days):
|
||||
if expires_in_days > self.EXPIRATION_ALERT_DAYS:
|
||||
|
|
Loading…
Reference in New Issue