This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch ut_close_socket
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/ut_close_socket by this push:
new 9e3a004 check whether jmx port is closed
9e3a004 is described below
commit 9e3a00453dd26a217871e75a61e63758a455e731
Author: xiangdong huang <[email protected]>
AuthorDate: Tue Feb 18 00:44:19 2020 +0800
check whether jmx port is closed
---
pom.xml | 2 +-
.../java/org/apache/iotdb/db/utils/EnvironmentUtils.java | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 42bb9d7..8f754f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -788,7 +788,7 @@
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
- <version>1.4.0</version>
+ <version>1.3.0</version>
<executions>
<execution>
<id>get-thrift-executable</id>
diff --git
a/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
b/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
index 28d5e99..a6de3c9 100644
--- a/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
+++ b/server/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
@@ -22,6 +22,9 @@ import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+import javax.management.remote.JMXServiceURL;
import org.apache.commons.io.FileUtils;
import org.apache.iotdb.db.auth.AuthException;
import org.apache.iotdb.db.auth.authorizer.LocalFileAuthorizer;
@@ -84,6 +87,18 @@ public class EnvironmentUtils {
} catch (TTransportException e) {
}
}
+ //try jmx connection
+ try {
+ JMXServiceURL url =
+ new
JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:31999/jmxrmi");
+ JMXConnector jmxConnector = JMXConnectorFactory.connect(url);
+ logger.error("stop JMX failed. 31999 can be connected now.");
+ jmxConnector.close();
+ } catch (IOException e) {
+ //do nothing
+ }
+
+
QueryResourceManager.getInstance().endQuery(TEST_QUERY_JOB_ID);
// clear opened file streams
FileReaderManager.getInstance().closeAndRemoveAllOpenedReaders();