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

GH-2787: Deadlock in JenaSystem.init() #2792

Closed

Conversation

arne-bdt
Copy link
Contributor

@arne-bdt arne-bdt commented Oct 23, 2024

Added a fail-fast mechanism: now throwing an ExceptionInInitializerError when a thread attempts to enter JenaSystem.init() while another thread is in the initialization process.

Refactored JenaSystem.init() using the "Initialization-on-demand holder idiom" for simpler and safer initialization.

Additionally, I have added integration tests for JenaSystem.init(), including the parallel execution scenario from the issue, to ensure coverage of potential concurrency issues.

GitHub issue resolved #2787


  • Tests are included.
  • Commits have been squashed to remove intermediate development commit messages.
  • Key commit messages start with the issue number (GH-xxxx)

By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.


See the Apache Jena "Contributing" guide.

@afs afs marked this pull request as draft October 23, 2024 21:26
@afs
Copy link
Member

afs commented Oct 23, 2024

I'm unsure about this PR,

I set this PR to "draft" - hope you don't mind.

- Added a fail-fast mechanism: now throwing an `ExceptionInInitializerError` when a thread attempts to enter `JenaSystem.init()` while another thread is in the initialization process.
- Refactored `JenaSystem.init()` using the "Initialization-on-demand holder idiom" for simpler and safer initialization.
- Implemented integration tests for `JenaSystem.init()`, including parallel execution cases to ensure thread safety.
@arne-bdt arne-bdt force-pushed the GH-2787-Deadlock_in_Jena_System_init branch from 482bbd1 to d5f000a Compare October 24, 2024 10:21
@arne-bdt
Copy link
Contributor Author

I found another "solution": Added a fail-fast mechanism: now throwing an ExceptionInInitializerError when a thread attempts to enter JenaSystem.init() while another thread is in the initialization process.

What do you think?

@afs
Copy link
Member

afs commented Oct 24, 2024

I think requiring single threaded initialization will break existing usage. Until we agree that it is the only option, I don't think we should go that way.

Discussion on the issue.

@arne-bdt arne-bdt closed this Oct 24, 2024
@arne-bdt
Copy link
Contributor Author

see #2787 (comment)

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.

Deadlock in JenaSystem.init() ?
2 participants