59520d6006
When multiple agents register at the same time there is
a possible race condition causing segment host mappings
updates to fail. StaleDataError raised by SQLAlchemy ORM.
Adding retry_if_session_inactive() decorator to the method
fixes the issue.
Also serialize the method with lockutils. It takes 25+
seconds to update segment host mappings for 10 agents with
the retry decorator alone. With the method serialized the
same operation completes in less than 1 second. The retry
decorator is still required for active/active scenarios.
Closes-Bug: #1743579
Change-Id: I616457f094d000a4016c610b454be8269d9b4948
(cherry picked from commit
|
||
---|---|---|
.. | ||
__init__.py | ||
db.py | ||
exceptions.py | ||
placement_client.py | ||
plugin.py |