A mistack caused by temporary_mutation reentry
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned | ||
Stein |
New
|
Undecided
|
Unassigned |
Bug Description
nova.virt.
Assignment statement inst_type=
Function _live_migration
Function temporary_mutation is called by obj_load_attr. The mistack caused by the temporary_mutation is called by two threads simultaneously。
Time0: self._context[
Time1: ThreadA called temporary_mutation, self._context[
Time2: ThreadB called temporary_mutation, self._context[
Time3: ThreadA executing finally code of temporary_mutation, the value of self._context[
Time3: ThreadA executing finally code of temporary_mutation, the value of self._context[
Result : Two calls to temporary_mutation cause the value of self._context[
affects: | fuel-plugin-contrail → nova |
Do you have a way to reliably reproduce the issue? That would help a lot to fix the issue.
Just to avoid confusion in general nova uses eventlet for parallelism (there are some exceptions). Eventlet / greenlet implements cooperate parallelism. So there is no preemption between threads. There are certain points in the execution when eventlet schedules threads. Mostly around external IO operations. As obj_load_attr potentially calls RPC back to controller node to read data from the database, and that RPC is an IO, thread switching can happen in a place you described. So I do think what you described is a potential bug. But we would need a reproduction to actually fix it. And probably such reproduction would be then useful to find other similar parallel issues.