apache / apache/arrow

[C++] We use ThreadPool to read hdfsfile, when the std::thread finished, it call the deadlock!

Open
#36,432 7 comments 0 reactions 0 assignees View on GitHub
Component: C++ Type: bug
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the bug, including details regarding any error messages, version, and platform.

we use ThreadPool to read hdfsfile, when the std::thread finishes task,it is destroyed and the hdfsThreadDestructor could be called.
![image](https://github.com/apache/arrow/assets/62052325/e4b246ad-5e73-4f0a-960e-23352beb73d5)
In the hdfsThreadDestructor , it will call (*env)->GetJavaVM(env, &vm) and it couldn't get the vm which is condition wait, so the program is not finished.
![image](https://github.com/apache/arrow/assets/62052325/e46e3383-ca70-4160-b964-27c50a431c97)

arrow version: apache-arrow-11.0.0
hadoop version: branch-3.2.0

### Component(s)

C++

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.