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/12/11 00:52:18 UTC
[GitHub] [flink] kezhuw opened a new pull request #14361: Flink 19435 deadlock while establish different jdbc connection concurrently
kezhuw opened a new pull request #14361:
URL: https://github.com/apache/flink/pull/14361
## What is the purpose of the change
Fix deadlock when loading different driver classes concurrently using `Class.forName`.
## Brief change log
- Add hang test case to reveal deadlock when loading different sql driver classes concurrently using Class.forName.
- Fix deadlock when loading different sql driver classes concurrently using Class.forName.
## Verifying this change
This change added tests and can be verified as follows:
- Add test `SimpleJdbcConnectionProviderDriverClassConcurrentLoadingTest#testDriverClassConcurrentLoading`.
## 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, Kubernetes/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)
----------------------------------------------------------------
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 #14361: Flink 19435 deadlock while establish different jdbc connection concurrently
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742895133
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 fc55e236955b84396bed5f18851cd9dd0425060a (Fri Dec 11 00:54:45 UTC 2020)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
* **Invalid pull request title: No valid Jira ID provided**
<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 #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fc55e236955b84396bed5f18851cd9dd0425060a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783)
<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 commented on a change in pull request #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #14361:
URL: https://github.com/apache/flink/pull/14361#discussion_r545733120
##########
File path: flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/internal/connection/SimpleJdbcConnectionProviderDriverClassConcurrentLoadingTest.java
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.connector.jdbc.internal.connection;
+
+import org.apache.flink.connector.jdbc.JdbcConnectionOptions;
+import org.apache.flink.connector.jdbc.fakedb.FakeDBUtils;
+import org.apache.flink.core.testutils.CheckedThread;
+
+import org.junit.Test;
+
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.util.concurrent.CountDownLatch;
+import java.util.function.Function;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * This test deals with sql driver class loading issues, write it alone so it won't be
+ * interfered by other tests.
+ */
+public class SimpleJdbcConnectionProviderDriverClassConcurrentLoadingTest {
+ private static boolean isClassLoaded(ClassLoader classLoader, String className) throws Exception {
+ do {
+ Method m = ClassLoader.class.getDeclaredMethod("findLoadedClass", String.class);
+ m.setAccessible(true);
+ Object loadedClass = m.invoke(classLoader, className);
+ if (loadedClass != null) {
+ return true;
+ }
+ classLoader = classLoader.getParent();
+ } while (classLoader != null);
+ return false;
+ }
+
+ @Test
Review comment:
Would be better to add a timeout on the test, otherwise, it's hard to find which test eaten up the test time.
----------------------------------------------------------------
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 #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
}, {
"hash" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fc55e236955b84396bed5f18851cd9dd0425060a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783)
* c58cf4c33c3c645048409a3ea8664c330c176a25 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 #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
}, {
"hash" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819",
"triggerID" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* c58cf4c33c3c645048409a3ea8664c330c176a25 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819)
<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 commented on pull request #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-747901269
Sorry for the late response. We were on business trip of Flink Forward Asia. I will review this PR later today.
----------------------------------------------------------------
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 #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fc55e236955b84396bed5f18851cd9dd0425060a Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783)
<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 #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
}, {
"hash" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819",
"triggerID" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"triggerType" : "PUSH"
}, {
"hash" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11024",
"triggerID" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"triggerType" : "PUSH"
}, {
"hash" : "00c2bb5f9c7e648aebf70fdc556f5d7322b8cf3f",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11064",
"triggerID" : "00c2bb5f9c7e648aebf70fdc556f5d7322b8cf3f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 0aa90c60d5e038daeb11b9ed90ef1226a4410613 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11024)
* 00c2bb5f9c7e648aebf70fdc556f5d7322b8cf3f Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11064)
<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 #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
}, {
"hash" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819",
"triggerID" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fc55e236955b84396bed5f18851cd9dd0425060a Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783)
* c58cf4c33c3c645048409a3ea8664c330c176a25 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819)
<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 commented on pull request #14361: Flink 19435 deadlock while establish different jdbc connection concurrently
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fc55e236955b84396bed5f18851cd9dd0425060a 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 #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
}, {
"hash" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819",
"triggerID" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"triggerType" : "PUSH"
}, {
"hash" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11024",
"triggerID" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* c58cf4c33c3c645048409a3ea8664c330c176a25 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819)
* 0aa90c60d5e038daeb11b9ed90ef1226a4410613 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11024)
<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] kezhuw commented on pull request #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
kezhuw commented on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-748474820
I have reported two failed test cases in building https://github.com/apache/flink/pull/14361/commits/0aa90c60d5e038daeb11b9ed90ef1226a4410613:
* [SQLClientSchemaRegistryITCase.testReading](https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=11024&view=logs&j=c88eea3b-64a0-564d-0031-9fdcd7b8abee&t=ff888d9b-cd34-53cc-d90f-3e446d355529&l=26627) in [FLINK-20432](https://issues.apache.org/jira/browse/FLINK-20432).
* [UnalignedCheckpointITCase.execute](https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=11024&view=logs&j=5c8e7682-d68f-54d1-16a2-a09310218a49&t=f508e270-48d6-5f1e-3138-42a17e0714f0&l=4050) in [FLINK-20389](https://issues.apache.org/jira/browse/FLINK-20389).
I will do an rebase on latest origin/master to squash fixup commit, reduce noise and trigger another ci run.
----------------------------------------------------------------
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 closed pull request #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
wuchong closed pull request #14361:
URL: https://github.com/apache/flink/pull/14361
----------------------------------------------------------------
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 #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
}, {
"hash" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819",
"triggerID" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"triggerType" : "PUSH"
}, {
"hash" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11024",
"triggerID" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"triggerType" : "PUSH"
}, {
"hash" : "00c2bb5f9c7e648aebf70fdc556f5d7322b8cf3f",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "00c2bb5f9c7e648aebf70fdc556f5d7322b8cf3f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 0aa90c60d5e038daeb11b9ed90ef1226a4410613 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11024)
* 00c2bb5f9c7e648aebf70fdc556f5d7322b8cf3f 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] kezhuw commented on a change in pull request #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
kezhuw commented on a change in pull request #14361:
URL: https://github.com/apache/flink/pull/14361#discussion_r545755979
##########
File path: flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/internal/connection/SimpleJdbcConnectionProviderDriverClassConcurrentLoadingTest.java
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.connector.jdbc.internal.connection;
+
+import org.apache.flink.connector.jdbc.JdbcConnectionOptions;
+import org.apache.flink.connector.jdbc.fakedb.FakeDBUtils;
+import org.apache.flink.core.testutils.CheckedThread;
+
+import org.junit.Test;
+
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.util.concurrent.CountDownLatch;
+import java.util.function.Function;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * This test deals with sql driver class loading issues, write it alone so it won't be
+ * interfered by other tests.
+ */
+public class SimpleJdbcConnectionProviderDriverClassConcurrentLoadingTest {
+ private static boolean isClassLoaded(ClassLoader classLoader, String className) throws Exception {
+ do {
+ Method m = ClassLoader.class.getDeclaredMethod("findLoadedClass", String.class);
+ m.setAccessible(true);
+ Object loadedClass = m.invoke(classLoader, className);
+ if (loadedClass != null) {
+ return true;
+ }
+ classLoader = classLoader.getParent();
+ } while (classLoader != null);
+ return false;
+ }
+
+ @Test
Review comment:
Done. I have added a 5s timeout in fixup commit, it should be sufficient for this test as there is no IO operations.
----------------------------------------------------------------
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 #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
}, {
"hash" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819",
"triggerID" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"triggerType" : "PUSH"
}, {
"hash" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11024",
"triggerID" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 0aa90c60d5e038daeb11b9ed90ef1226a4410613 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11024)
<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 #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
}, {
"hash" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819",
"triggerID" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"triggerType" : "PUSH"
}, {
"hash" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11024",
"triggerID" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"triggerType" : "PUSH"
}, {
"hash" : "00c2bb5f9c7e648aebf70fdc556f5d7322b8cf3f",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11064",
"triggerID" : "00c2bb5f9c7e648aebf70fdc556f5d7322b8cf3f",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 00c2bb5f9c7e648aebf70fdc556f5d7322b8cf3f Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=11064)
<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 commented on pull request #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
wuchong commented on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-748721119
Azure is passed. Will merge this.
----------------------------------------------------------------
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] kezhuw commented on pull request #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
kezhuw commented on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742904371
@flinkbot
----------------------------------------------------------------
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] kezhuw commented on pull request #14361: Flink 19435 deadlock while establish different jdbc connection concurrently
Posted by GitBox <gi...@apache.org>.
kezhuw commented on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742900680
@flinkbot attention @wuchong @JingsongLi
----------------------------------------------------------------
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 #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14361:
URL: https://github.com/apache/flink/pull/14361#issuecomment-742899629
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10783",
"triggerID" : "fc55e236955b84396bed5f18851cd9dd0425060a",
"triggerType" : "PUSH"
}, {
"hash" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819",
"triggerID" : "c58cf4c33c3c645048409a3ea8664c330c176a25",
"triggerType" : "PUSH"
}, {
"hash" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "0aa90c60d5e038daeb11b9ed90ef1226a4410613",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* c58cf4c33c3c645048409a3ea8664c330c176a25 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=10819)
* 0aa90c60d5e038daeb11b9ed90ef1226a4410613 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] wuchong commented on a change in pull request #14361: [FLINK-19435][connectors/jdbc] Fix deadlock when loading different driver classes concurrently using Class.forName
Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #14361:
URL: https://github.com/apache/flink/pull/14361#discussion_r545733120
##########
File path: flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/internal/connection/SimpleJdbcConnectionProviderDriverClassConcurrentLoadingTest.java
##########
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.connector.jdbc.internal.connection;
+
+import org.apache.flink.connector.jdbc.JdbcConnectionOptions;
+import org.apache.flink.connector.jdbc.fakedb.FakeDBUtils;
+import org.apache.flink.core.testutils.CheckedThread;
+
+import org.junit.Test;
+
+import java.lang.reflect.Method;
+import java.sql.Connection;
+import java.util.concurrent.CountDownLatch;
+import java.util.function.Function;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * This test deals with sql driver class loading issues, write it alone so it won't be
+ * interfered by other tests.
+ */
+public class SimpleJdbcConnectionProviderDriverClassConcurrentLoadingTest {
+ private static boolean isClassLoaded(ClassLoader classLoader, String className) throws Exception {
+ do {
+ Method m = ClassLoader.class.getDeclaredMethod("findLoadedClass", String.class);
+ m.setAccessible(true);
+ Object loadedClass = m.invoke(classLoader, className);
+ if (loadedClass != null) {
+ return true;
+ }
+ classLoader = classLoader.getParent();
+ } while (classLoader != null);
+ return false;
+ }
+
+ @Test
Review comment:
Would be better to add a timeout on the test, otherwise, it's hard to find which test eaten up the test time if the test is broken in the future.
----------------------------------------------------------------
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