-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dead lock when adding child memory pool with already existing name #10342
Comments
cc @xiaoxmeng |
@zhztheplayer The call stack you gave is very helpful, and I feel like I already know the cause of the problem, I can write a cause analysis of this problem soon. I can give a quick fix if you are not working on this bug. In addition, I am curious: in what scenario would you try to add a child node with a duplicate name? Can you share a little bit? |
The root cause of this problem comes from
In other words, to avoid deadlock:
addAggregateChild() ------ will acquire 'poolMutex_'
--> toString() [When duplicate names appear, used to print error messages]
--> usedBytes()
--> visitChildren() ------ [When reservedBytes() != 0] will acquire 'poolMutex_' again, **DEADLOCK!!** So, To solve this problem, the easiest way is to simplify the error message printed when duplicate names appear. |
@zhztheplayer I created #10400 to fix this bug. |
This causes the intended error
Child memory pool {} already exists in {}
never get raised.Code that acquired lock:
velox/velox/common/memory/MemoryPool.cpp
Lines 349 to 355 in cc6ac91
Code that awaits for lock:
velox/velox/common/memory/MemoryPool.cpp
Lines 276 to 288 in cc6ac91
Call stack:
The text was updated successfully, but these errors were encountered: