-
Notifications
You must be signed in to change notification settings - Fork 33
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
ModelObject() threadsafety? #167
Comments
Yes - it should be thread-safe. From looking at the code, this does look like an issue with the library. I should be able to resolve this by wrapping the code with enter/exit critical section. I noticed a similar issue in the I'll create a pull request to fix. |
Partial fix to issue #167 Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
Created PR #170 to resolve the immediate issue. In reviewing the code, I found a couple potential issues not addressed in the PR: #169 and #168 @mathjeff let me know if you'd like a release of this fix. Note - it may also require a release of the RDF format store as well. If it isn't too much effort, it would be great to test this out prior to release since the fix has a (low) probability of a deadlock. |
Thanks! I'll get back to you soon about a doing a release if it's not too much trouble - in the meanwhile I'm double-checking that everything else about 1.1.6-SNAPSHOT works well for us ( so far the only other difficulty we've noticed is #171 ) |
It looks like this is resolved, so closing the issue. |
@mathjeff - FYI - I just finished a new release of the library and tools-java which includes this PR. |
AndroidX is trying out https://github.com/spdx/spdx-gradle-plugin and finding that occasionally
./gradlew spdxSbomForRelease
fails with a stacktrace that looks like this:So far we've only noticed this failure when parallelism is enabled (--max-workers > 1)
I believe that what is happening is that the Gradle plugin is calling
SpdxNoAssertionLicense()
from multiple threads at once, and that the code atSpdx-Java-Library/src/main/java/org/spdx/library/model/ModelObject.java
Line 198 in da021df
Spdx-Java-Library/src/main/java/org/spdx/library/model/ModelObject.java
Line 204 in da021df
Does it seem right for the spdx-gradle-plugin to access the default model store from several threads concurrently for writing several spdx documents? Is ModelObject() expected to be threadsafe?
Thanks!
The text was updated successfully, but these errors were encountered: