You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/08/26 03:45:29 UTC

[GitHub] [flink] leonardBang opened a new pull request #13244: [FLINK-18333][jdbc] UnsignedTypeConversionITCase failed caused by MariaDB4j "Asked to waitFor Program"

leonardBang opened a new pull request #13244:
URL: https://github.com/apache/flink/pull/13244


   ## What is the purpose of the change
   
   * This pull request fix up unstable test UnsignedTypeConversionITCase.
   
   
   ## Brief change log
   
     - Avoid using MariaDB4jRule to create a DB instance, because the MariaDB4jRule will pull up a `ManagedProcess` to run the create db statement which may exit unexpected.
   - Add retry logic for initializing the DB instance. 
   
   ## Verifying this change
   
   This change is an unstable test fix.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): ( no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #13244: [FLINK-18333][jdbc] UnsignedTypeConversionITCase failed caused by MariaDB4j "Asked to waitFor Program"

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13244:
URL: https://github.com/apache/flink/pull/13244#issuecomment-680535784


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f5fee133d28436ab73b03d05b1f6fadc8648f5d0 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13244: [FLINK-18333][jdbc] UnsignedTypeConversionITCase failed caused by MariaDB4j "Asked to waitFor Program"

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13244:
URL: https://github.com/apache/flink/pull/13244#issuecomment-680535784


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5869",
       "triggerID" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f5fee133d28436ab73b03d05b1f6fadc8648f5d0 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5869) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13244: [FLINK-18333][jdbc] UnsignedTypeConversionITCase failed caused by MariaDB4j "Asked to waitFor Program"

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13244:
URL: https://github.com/apache/flink/pull/13244#issuecomment-680535784


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5869",
       "triggerID" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c6afc2e13a7c112c0b65d0fb64b13224ec55efd",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "9c6afc2e13a7c112c0b65d0fb64b13224ec55efd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f5fee133d28436ab73b03d05b1f6fadc8648f5d0 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5869) 
   * 9c6afc2e13a7c112c0b65d0fb64b13224ec55efd UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13244: [FLINK-18333][jdbc] UnsignedTypeConversionITCase failed caused by MariaDB4j "Asked to waitFor Program"

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13244:
URL: https://github.com/apache/flink/pull/13244#issuecomment-680535784


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5869",
       "triggerID" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f5fee133d28436ab73b03d05b1f6fadc8648f5d0 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5869) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wuchong merged pull request #13244: [FLINK-18333][jdbc] UnsignedTypeConversionITCase failed caused by MariaDB4j "Asked to waitFor Program"

Posted by GitBox <gi...@apache.org>.
wuchong merged pull request #13244:
URL: https://github.com/apache/flink/pull/13244


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] wuchong commented on a change in pull request #13244: [FLINK-18333][jdbc] UnsignedTypeConversionITCase failed caused by MariaDB4j "Asked to waitFor Program"

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #13244:
URL: https://github.com/apache/flink/pull/13244#discussion_r478448798



##########
File path: flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/UnsignedTypeConversionITCase.java
##########
@@ -60,27 +60,54 @@
 	private static final String TABLE_NAME = "unsigned_test";
 
 	private StreamTableEnvironment tEnv;
+	private DB db;
 	private String dbUrl;
 	private Connection connection;
 
-	@ClassRule
-	public static MariaDB4jRule db4jRule = new MariaDB4jRule(
-		DBConfigurationBuilder.newBuilder().build(),
-		DEFAULT_DB_NAME,
-		null);
-
 	@Before
-	public void setUp() throws SQLException, ClassNotFoundException {
-		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
-		tEnv = StreamTableEnvironment.create(env);
+	public void setUp() throws SQLException, IllegalStateException {
 		//dbUrl: jdbc:mysql://localhost:3306/test
-		dbUrl = db4jRule.getURL();
-		connection = DriverManager.getConnection(dbUrl);
+		prepareMariaDB();
 		createMysqlTable();
+		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+		tEnv = StreamTableEnvironment.create(env);
 		createFlinkTable();
 		prepareData();
 	}
 
+	private void prepareMariaDB() throws IllegalStateException {
+		boolean initDbSuccess = false;
+		int i = 0;
+		//retry
+		while (i < 3) {
+			try {
+				db = DB.newEmbeddedDB(DBConfigurationBuilder.newBuilder().build());
+				db.start();
+				dbUrl = db.getConfiguration().getURL(DEFAULT_DB_NAME);
+				connection = DriverManager.getConnection(dbUrl);
+				try (Statement statement = connection.createStatement()) {
+					statement.execute("CREATE DATABASE IF NOT EXISTS `" + DEFAULT_DB_NAME + "`;");
+					ResultSet resultSet = statement.executeQuery("SELECT SCHEMA_NAME FROM " +
+						"INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '" + DEFAULT_DB_NAME + "';");
+					if (resultSet.next()) {
+						String dbName = resultSet.getString(1);
+						initDbSuccess = DEFAULT_DB_NAME.equalsIgnoreCase(dbName);
+					}
+				}
+			} catch (Exception e) {
+				log.info("Initialize DB fail caused by {}", e);

Review comment:
       log.warn?

##########
File path: flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/UnsignedTypeConversionITCase.java
##########
@@ -60,27 +60,54 @@
 	private static final String TABLE_NAME = "unsigned_test";
 
 	private StreamTableEnvironment tEnv;
+	private DB db;
 	private String dbUrl;
 	private Connection connection;
 
-	@ClassRule
-	public static MariaDB4jRule db4jRule = new MariaDB4jRule(
-		DBConfigurationBuilder.newBuilder().build(),
-		DEFAULT_DB_NAME,
-		null);
-
 	@Before
-	public void setUp() throws SQLException, ClassNotFoundException {
-		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
-		tEnv = StreamTableEnvironment.create(env);
+	public void setUp() throws SQLException, IllegalStateException {
 		//dbUrl: jdbc:mysql://localhost:3306/test
-		dbUrl = db4jRule.getURL();
-		connection = DriverManager.getConnection(dbUrl);
+		prepareMariaDB();
 		createMysqlTable();
+		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+		tEnv = StreamTableEnvironment.create(env);
 		createFlinkTable();
 		prepareData();
 	}
 
+	private void prepareMariaDB() throws IllegalStateException {
+		boolean initDbSuccess = false;
+		int i = 0;
+		//retry

Review comment:
       Please add more comments for why we add a retry here, we can also link the issue. 

##########
File path: flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/UnsignedTypeConversionITCase.java
##########
@@ -60,27 +60,54 @@
 	private static final String TABLE_NAME = "unsigned_test";
 
 	private StreamTableEnvironment tEnv;
+	private DB db;
 	private String dbUrl;
 	private Connection connection;
 
-	@ClassRule
-	public static MariaDB4jRule db4jRule = new MariaDB4jRule(
-		DBConfigurationBuilder.newBuilder().build(),
-		DEFAULT_DB_NAME,
-		null);
-
 	@Before
-	public void setUp() throws SQLException, ClassNotFoundException {
-		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
-		tEnv = StreamTableEnvironment.create(env);
+	public void setUp() throws SQLException, IllegalStateException {
 		//dbUrl: jdbc:mysql://localhost:3306/test
-		dbUrl = db4jRule.getURL();
-		connection = DriverManager.getConnection(dbUrl);
+		prepareMariaDB();

Review comment:
       I would suggest to prepare DB in a `@ClassBefore` instead of `@Before` to avoid repeated initialization between tests. 

##########
File path: flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/UnsignedTypeConversionITCase.java
##########
@@ -60,27 +60,54 @@
 	private static final String TABLE_NAME = "unsigned_test";
 
 	private StreamTableEnvironment tEnv;
+	private DB db;
 	private String dbUrl;
 	private Connection connection;
 
-	@ClassRule
-	public static MariaDB4jRule db4jRule = new MariaDB4jRule(
-		DBConfigurationBuilder.newBuilder().build(),
-		DEFAULT_DB_NAME,
-		null);
-
 	@Before
-	public void setUp() throws SQLException, ClassNotFoundException {
-		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
-		tEnv = StreamTableEnvironment.create(env);
+	public void setUp() throws SQLException, IllegalStateException {
 		//dbUrl: jdbc:mysql://localhost:3306/test
-		dbUrl = db4jRule.getURL();
-		connection = DriverManager.getConnection(dbUrl);
+		prepareMariaDB();
 		createMysqlTable();
+		StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
+		tEnv = StreamTableEnvironment.create(env);
 		createFlinkTable();
 		prepareData();
 	}
 
+	private void prepareMariaDB() throws IllegalStateException {
+		boolean initDbSuccess = false;
+		int i = 0;
+		//retry
+		while (i < 3) {
+			try {
+				db = DB.newEmbeddedDB(DBConfigurationBuilder.newBuilder().build());
+				db.start();
+				dbUrl = db.getConfiguration().getURL(DEFAULT_DB_NAME);
+				connection = DriverManager.getConnection(dbUrl);
+				try (Statement statement = connection.createStatement()) {
+					statement.execute("CREATE DATABASE IF NOT EXISTS `" + DEFAULT_DB_NAME + "`;");
+					ResultSet resultSet = statement.executeQuery("SELECT SCHEMA_NAME FROM " +
+						"INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '" + DEFAULT_DB_NAME + "';");
+					if (resultSet.next()) {
+						String dbName = resultSet.getString(1);
+						initDbSuccess = DEFAULT_DB_NAME.equalsIgnoreCase(dbName);
+					}
+				}
+			} catch (Exception e) {
+				log.info("Initialize DB fail caused by {}", e);

Review comment:
       stop the DB to release potential resources if errors happen?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot commented on pull request #13244: [FLINK-18333][jdbc] UnsignedTypeConversionITCase failed caused by MariaDB4j "Asked to waitFor Program"

Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #13244:
URL: https://github.com/apache/flink/pull/13244#issuecomment-680526208


   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit f5fee133d28436ab73b03d05b1f6fadc8648f5d0 (Wed Aug 26 03:47:11 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13244: [FLINK-18333][jdbc] UnsignedTypeConversionITCase failed caused by MariaDB4j "Asked to waitFor Program"

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13244:
URL: https://github.com/apache/flink/pull/13244#issuecomment-680535784


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5869",
       "triggerID" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c6afc2e13a7c112c0b65d0fb64b13224ec55efd",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5959",
       "triggerID" : "9c6afc2e13a7c112c0b65d0fb64b13224ec55efd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f5fee133d28436ab73b03d05b1f6fadc8648f5d0 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5869) 
   * 9c6afc2e13a7c112c0b65d0fb64b13224ec55efd Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5959) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] flinkbot edited a comment on pull request #13244: [FLINK-18333][jdbc] UnsignedTypeConversionITCase failed caused by MariaDB4j "Asked to waitFor Program"

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #13244:
URL: https://github.com/apache/flink/pull/13244#issuecomment-680535784


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5869",
       "triggerID" : "f5fee133d28436ab73b03d05b1f6fadc8648f5d0",
       "triggerType" : "PUSH"
     }, {
       "hash" : "9c6afc2e13a7c112c0b65d0fb64b13224ec55efd",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5959",
       "triggerID" : "9c6afc2e13a7c112c0b65d0fb64b13224ec55efd",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 9c6afc2e13a7c112c0b65d0fb64b13224ec55efd Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=5959) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [flink] leonardBang commented on pull request #13244: [FLINK-18333][jdbc] UnsignedTypeConversionITCase failed caused by MariaDB4j "Asked to waitFor Program"

Posted by GitBox <gi...@apache.org>.
leonardBang commented on pull request #13244:
URL: https://github.com/apache/flink/pull/13244#issuecomment-680787249


   cc @wuchong Could you help review this PR?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org