jorgecarleitao opened a new pull request #8018:
URL: https://github.com/apache/arrow/pull/8018
@andygrove and @alamb , I have no formal training in thread and mutex
management, so I am not certain about this proposal or the following
explanation:
My understanding is that because the result of
```
ctx_state
.lock()
.expect("failed to lock mutex")
.scalar_functions
.lock()
.expect("failed to lock mutex")
.get(name)
```
is of temporary lifetime, using this in `match` blocks any access to
`scalar_functions` until we leave the match, which deadlocks when we
recursively call the function. Here I just cloned `.scalar_functions` so that
we allow the lock to be released.
I may also be dead wrong in every word that I wrote above.
This does work, but if you could validate my reasoning above, I would
appreciate very much!
Note that we are also doing the same for `.datasources` in this file, which
I suspect will also deadlock if when we have a plan with two sources. I did not
touch that as I do not know the idiom/pattern to address this (locking within
recursions).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]