private static void logPropChanges(Properties newProps) {
    if (prop == null) {
      LOG.info("Current pmf properties are uninitialized");
      return;
    }
    LOG.info("Updating the pmf due to property change");
    if (LOG.isDebugEnabled() && !newProps.equals(prop)) {
      for (String key : prop.stringPropertyNames()) {
        if (!key.equals(newProps.get(key))) {
          if (LOG.isDebugEnabled() && MetastoreConf.isPrintable(key)) {
            // The jdbc connection url can contain sensitive information like username and password
            // which should be masked out before logging.
            String oldVal = prop.getProperty(key);
            String newVal = newProps.getProperty(key);
            if (key.equals(ConfVars.CONNECT_URL_KEY.getVarname())) {
              oldVal = MetaStoreServerUtils.anonymizeConnectionURL(oldVal);
              newVal = MetaStoreServerUtils.anonymizeConnectionURL(newVal);
            }
            LOG.debug("Found {} to be different. Old val : {} : New Val : {}", key,
                oldVal, newVal);
          } else {
            LOG.debug("Found masked property {} to be different", key);
          }
        }
      }
    }
  }
When closing PersistenceManagerFactory, the connection factory should be closed as well,
otherwise the underlying dangling connections would be accumulated resulting to connection leaks.
See TestDataSourceProviderFactory#testClosePersistenceManagerProvider for details.
@param pmf the PersistenceManagerFactory tended to be closed
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/PersistenceManagerProvider.java