Noticed this in running some tests. RegionServer was shutting down and MetaDataRegionObserver was just invoking postOpen
When the Class.forName(PhoenixDriver.class.getName()) gets called, the static initializer in PhoenixDriver gets invoked. Because the RegionServer is already stopping, the addShutdownHook fails with an IllegalArgumentException.
It's not a huge concern because we know the JVM is going down, but there are a few things we could handle better:
- Ensure the PhoenixDriver gets closed if the shutdown hook fails to register
- Avoid registering the PhoenixDriver instance if we're shutting down