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

Make accessFilter file registration thread safe #635

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

dnestoro
Copy link
Collaborator

@dnestoro dnestoro commented Oct 31, 2024

This PR should fix #626

Described issue probably occurs in multi-threaded environment because the reported error throws FileAlreadyExistsException even though we checked first that file doesn't exist.

As per documentation of java.nio.file.Files#createDirectory:

Creates a new directory. The check for the existence of the file and the creation of the directory if it does not exist are a single operation that is atomic with respect to all other filesystem activities that might affect the directory

Since we only care that directory with the given name exists, we can just catch and ignore FileAlreadyExistsException in this case.

@dnestoro dnestoro requested review from melix and olpaw October 31, 2024 15:09
@dnestoro dnestoro self-assigned this Oct 31, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 31, 2024
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. and removed OCA Verified All contributors have signed the Oracle Contributor Agreement. labels Nov 5, 2024
@dnestoro dnestoro force-pushed the dnestoro/MakeAccessFilterFileRegistrationThreadSafe branch from 3ae135b to cc19b6d Compare November 12, 2024 12:21
@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Verified All contributors have signed the Oracle Contributor Agreement. and removed OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. labels Nov 12, 2024
@dnestoro dnestoro requested review from olpaw and melix November 12, 2024 12:22
olpaw
olpaw previously approved these changes Nov 12, 2024
Copy link
Member

@olpaw olpaw left a comment

Choose a reason for hiding this comment

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

  • Adjust the logging and error messages before merging.

@dnestoro dnestoro force-pushed the dnestoro/MakeAccessFilterFileRegistrationThreadSafe branch from cc19b6d to 84b16a3 Compare November 12, 2024 13:50
@dnestoro dnestoro requested a review from olpaw November 12, 2024 13:50
@dnestoro dnestoro merged commit 47bda78 into master Nov 12, 2024
223 checks passed
@dnestoro dnestoro deleted the dnestoro/MakeAccessFilterFileRegistrationThreadSafe branch November 12, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sporadic Gradle failure: access-filter.json already exists
3 participants