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
non-thread-safe XPathFactory reused in XpathDirective.FACTORY #82
Comments
@carlosmiranda/z please, pay attention to this issue |
@rgevaerd/z this project will fix the problem faster if you donate a few dollars to it; just click here and pay via Stripe, it's very fast, convenient and appreciated; thanks a lot! |
@rgevaerd can you revise the description a bit with some more details? What is the problematic code and why? |
@carlosmiranda added more details to the description. |
@0crat in |
@carlosmiranda Job #82 is now in scope, role is |
Manual assignment of issues is discouraged, see §19: -5 point(s) just awarded to @carlosmiranda/z |
@rgevaerd Released as |
@carlosmiranda Thanks |
Job was finished in 21 hours, bonus for fast delivery is possible (see §36) |
Order was finished: +35 point(s) just awarded to @carlosmiranda/z |
The job #82 is now out of scope |
I believe this reuse of non-thread-safe object by xembly is causing zerocracy/farm#1167 (comment):
As you can see in XPathFactory documentation (https://docs.oracle.com/javase/8/docs/api/javax/xml/xpath/XPathFactory.html), it is not thread-safe and must never be used by more than one thread concurrently.
Xembly stores in the static final attribute
XpathDirective.FACTORY
an instance of such object and reuses it in many operations. Because of this, any multi-threaded application are subject to suffer misbehavior when using Xembly.The error above is one example of such misbehavior that may happen when using Xembly in more than one thread. In this case this exception occurs on a race condition when calling Xembler.xmlQuietly on different threads, even with the threads using their own Xembler instance (because xembly internally will reuse the same XPathFactory causing the error).
The text was updated successfully, but these errors were encountered: