Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#5361] improvment(hadoop-catalog): Introduce timeout mechanism to get Hadoop File System. #5406

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

yuqi1129
Copy link
Contributor

@yuqi1129 yuqi1129 commented Oct 31, 2024

What changes were proposed in this pull request?

Introduce a timeout mechanism when getting a Hadoop FileSystem instance.

Why are the changes needed?

Cloud filesystem like S3 and OSS(10 minutes) has a very long connection and can't be tune by configuration, this will cause deadlock as it will hold the tree lock for a long time

Fix: #5361
Fix: #6156

Does this PR introduce any user-facing change?

N/A.

How was this patch tested?

Existing test.

@yuqi1129
Copy link
Contributor Author

@jerryshao
Please help look if this should be included in release 0.7.0.

.atMost(timeoutSeconds, TimeUnit.SECONDS)
.until(
() -> {
fileSystem.set(provider.getFileSystem(path, config));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why it is so time-consuming to initialize the filesystem client?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user sets an incorrect endpoint, the client will retry to get the connection for a certain amount of time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you really fix this problem without using another thread to create a FS and polling the status asynchronously?

@yuqi1129 yuqi1129 self-assigned this Oct 31, 2024
@yuqi1129
Copy link
Contributor Author

yuqi1129 commented Dec 5, 2024

@jerryshao
Do you have any suggestions on this issue and should I proceed with it?

@yuqi1129 yuqi1129 requested a review from FANNG1 January 10, 2025 03:01
@yuqi1129 yuqi1129 changed the title [#5361] improvment(hadoop-catalog): Introduce a timeout mechanism to get Hadoop File System. [#5361] improvment(hadoop-catalog): Introduce timeout mechanism to get Hadoop File System. Jan 10, 2025
@jerryshao
Copy link
Contributor

I will spend time on this.

@yuqi1129
Copy link
Contributor Author

I will spend time on this.

Got

@yuqi1129 yuqi1129 added the branch-0.8 Automatically cherry-pick commit to branch-0.8 label Jan 10, 2025
} catch (ConditionTimeoutException e) {
throw new IOException(
String.format(
"Failed to get FileSystem for path: %s, scheme: %s, provider: %s, config: %s within %s seconds, please check the configuration or increase the "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line exceeds the 100 characters length, please break into lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

@@ -53,6 +53,10 @@ public class HadoopCatalogPropertiesMetadata extends BaseCatalogPropertiesMetada
*/
public static final String DEFAULT_FS_PROVIDER = "default-filesystem-provider";

static final String FILESYSTEM_CONNECTION_TIMEOUT_SECONDS =
"filesystem-connection-timeout-seconds";
static final int DEFAULT_GET_FILESYSTEM_TIMEOUT_SECONDS = 6;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why it is the "6" seconds we defined here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just an experience value. This specific setting depends on the environment at that time. I believe 6s is long enough to get the connection.

@@ -53,6 +53,10 @@ public class HadoopCatalogPropertiesMetadata extends BaseCatalogPropertiesMetada
*/
public static final String DEFAULT_FS_PROVIDER = "default-filesystem-provider";

static final String FILESYSTEM_CONNECTION_TIMEOUT_SECONDS =
"filesystem-connection-timeout-seconds";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configuration name is too long, can you make it shorter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about "filesystem-conn-timeout-sec"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-0.8 Automatically cherry-pick commit to branch-0.8
Projects
None yet
2 participants