Description
When using the file locking mechanism, the passive/slave node will keep on opening ports with the shutdown hook.
Adding a guard to prevent the locking loop from setting up multipe shutdown ports/threads should be enough to fix the issue on 2.4.x
The problem doesn't occur on 3.0.x or above, because of the changes in the locking mechanism implementation.