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

[#5596] Improvement(filesystem-hadoop3): Override the addDelegationTokens method to fix the token expired issue #5597

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

xloya
Copy link
Collaborator

@xloya xloya commented Nov 18, 2024

What changes were proposed in this pull request?

Pass the delegation token to the FileSystem managed by GVFS.

Why are the changes needed?

Fix: #5596

How was this patch tested?

Tests it in the production environment.

@xloya xloya self-assigned this Nov 18, 2024
@xloya xloya requested a review from jerryshao November 18, 2024 03:15
@xloya xloya changed the title [#5596] Improvement(filesystem-hadoop3): Overwrite addDelegationTokens method to fix the token expired issue [#5596] Improvement(filesystem-hadoop3): Override the addDelegationTokens method to fix the token expired issue Nov 18, 2024
@Override
public Token<?>[] addDelegationTokens(String renewer, Credentials credentials) {
List<Token<?>> tokenList = Lists.newArrayList();
for (FileSystem fileSystem : internalFileSystemCache.asMap().values()) {
Copy link
Contributor

@jerryshao jerryshao Nov 18, 2024

Choose a reason for hiding this comment

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

Shall we filter out some filesystems that doesn't have delegation token mechanism? For example, like local filesystem, S3, etc.

Copy link
Collaborator Author

@xloya xloya Nov 18, 2024

Choose a reason for hiding this comment

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

I think we don't need to do filtering, please see the specific code call:
image
image
image
image

  1. The getCanonicalServiceName and getChildFileSystems methods will always return null in the default implementations.
  2. Some FileSystems do not support token will also override the getCanonicalServiceName to return null directly(like S3AFileSystem, AliyunOSSFileSystem)
    image

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, thanks for the explanation.

@jerryshao jerryshao merged commit e0bce18 into apache:main Nov 18, 2024
25 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug report] Invalid token issue happened in GVFS when Spark job long running
2 participants