-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HIVE-24179: Memory leak in HS2 DbTxnManager when compiling SHOW LOCKS…
… statement (Stamatis Zampetakis, reviewed by Denys Kuzmenko, Jesus Camacho Rodriguez) 1. Avoid multiple shutdown hooks for the same threadpool in DbTxnManager. Enforce unique initialization and shutdown of the thread pool. Apart from the apparent memory leak there is no need to register a shutdown hook for the executor service multiple times. It wastes memory, complicates code, and serves no purpose. Change initHeartbeatExecutorService to synchronized putting the class lock in the whole method. Mixing instance and class locks is confusing and does not offer any particular benefit. 2. Avoid HiveTxnManager instantiation in lock analyzers. A transaction manager should already exist inside the analyzer before calling the analyze method. There is no need to create a new one just to obtain the useNewShowLocksFormat boolean indicator. Closes apache/hive#1509
- Loading branch information
Showing
2 changed files
with
19 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters